{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "_You are currently looking at **version 1.1** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from scipy.stats import ttest_ind"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Assignment 4 - Hypothesis Testing\n",
    "This assignment requires more individual learning than previous assignments - you are encouraged to check out the [pandas documentation](http://pandas.pydata.org/pandas-docs/stable/) to find functions or methods you might not have used yet, or ask questions on [Stack Overflow](http://stackoverflow.com/) and tag them as pandas and python related. And of course, the discussion forums are open for interaction with your peers and the course staff.\n",
    "\n",
    "Definitions:\n",
    "* A _quarter_ is a specific three month period, Q1 is January through March, Q2 is April through June, Q3 is July through September, Q4 is October through December.\n",
    "* A _recession_ is defined as starting with two consecutive quarters of GDP decline, and ending with two consecutive quarters of GDP growth.\n",
    "* A _recession bottom_ is the quarter within a recession which had the lowest GDP.\n",
    "* A _university town_ is a city which has a high percentage of university students compared to the total population of the city.\n",
    "\n",
    "**Hypothesis**: University towns have their mean housing prices less effected by recessions. Run a t-test to compare the ratio of the mean price of houses in university towns the quarter before the recession starts compared to the recession bottom. (`price_ratio=quarter_before_recession/recession_bottom`)\n",
    "\n",
    "The following data files are available for this assignment:\n",
    "* From the [Zillow research data site](http://www.zillow.com/research/data/) there is housing data for the United States. In particular the datafile for [all homes at a city level](http://files.zillowstatic.com/research/public/City/City_Zhvi_AllHomes.csv), ```City_Zhvi_AllHomes.csv```, has median home sale prices at a fine grained level.\n",
    "* From the Wikipedia page on college towns is a list of [university towns in the United States](https://en.wikipedia.org/wiki/List_of_college_towns#College_towns_in_the_United_States) which has been copy and pasted into the file ```university_towns.txt```.\n",
    "* From Bureau of Economic Analysis, US Department of Commerce, the [GDP over time](http://www.bea.gov/national/index.htm#gdp) of the United States in current dollars (use the chained value in 2009 dollars), in quarterly intervals, in the file ```gdplev.xls```. For this assignment, only look at GDP data from the first quarter of 2000 onward.\n",
    "\n",
    "Each function in this assignment below is worth 10%, with the exception of ```run_ttest()```, which is worth 50%."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use this dictionary to map state names to two letter acronyms\n",
    "states = {'OH': 'Ohio', 'KY': 'Kentucky', 'AS': 'American Samoa', 'NV': 'Nevada', 'WY': 'Wyoming', 'NA': 'National', 'AL': 'Alabama', 'MD': 'Maryland', 'AK': 'Alaska', 'UT': 'Utah', 'OR': 'Oregon', 'MT': 'Montana', 'IL': 'Illinois', 'TN': 'Tennessee', 'DC': 'District of Columbia', 'VT': 'Vermont', 'ID': 'Idaho', 'AR': 'Arkansas', 'ME': 'Maine', 'WA': 'Washington', 'HI': 'Hawaii', 'WI': 'Wisconsin', 'MI': 'Michigan', 'IN': 'Indiana', 'NJ': 'New Jersey', 'AZ': 'Arizona', 'GU': 'Guam', 'MS': 'Mississippi', 'PR': 'Puerto Rico', 'NC': 'North Carolina', 'TX': 'Texas', 'SD': 'South Dakota', 'MP': 'Northern Mariana Islands', 'IA': 'Iowa', 'MO': 'Missouri', 'CT': 'Connecticut', 'WV': 'West Virginia', 'SC': 'South Carolina', 'LA': 'Louisiana', 'KS': 'Kansas', 'NY': 'New York', 'NE': 'Nebraska', 'OK': 'Oklahoma', 'FL': 'Florida', 'CA': 'California', 'CO': 'Colorado', 'PA': 'Pennsylvania', 'DE': 'Delaware', 'NM': 'New Mexico', 'RI': 'Rhode Island', 'MN': 'Minnesota', 'VI': 'Virgin Islands', 'NH': 'New Hampshire', 'MA': 'Massachusetts', 'GA': 'Georgia', 'ND': 'North Dakota', 'VA': 'Virginia'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "umich_part_id": "021",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>RegionName</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Auburn</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Florence</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Jacksonville</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Livingston</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Montevallo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Troy</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Tuscaloosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Alabama</td>\n",
       "      <td>Tuskegee</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Alaska</td>\n",
       "      <td>Fairbanks</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Arizona</td>\n",
       "      <td>Flagstaff</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Arizona</td>\n",
       "      <td>Tempe</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Arizona</td>\n",
       "      <td>Tucson</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Arkadelphia</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Conway</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Fayetteville</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Jonesboro</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Magnolia</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Monticello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Russellville</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Arkansas</td>\n",
       "      <td>Searcy</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>California</td>\n",
       "      <td>Angwin</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>California</td>\n",
       "      <td>Arcata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>California</td>\n",
       "      <td>Berkeley</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>California</td>\n",
       "      <td>Chico</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>California</td>\n",
       "      <td>Claremont</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>California</td>\n",
       "      <td>Cotati</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>California</td>\n",
       "      <td>Davis</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>California</td>\n",
       "      <td>Irvine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>California</td>\n",
       "      <td>Isla Vista</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>California</td>\n",
       "      <td>University Park, Los Angeles</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>487</th>\n",
       "      <td>Virginia</td>\n",
       "      <td>Wise</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>488</th>\n",
       "      <td>Virginia</td>\n",
       "      <td>Chesapeake</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>489</th>\n",
       "      <td>Washington</td>\n",
       "      <td>Bellingham</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>490</th>\n",
       "      <td>Washington</td>\n",
       "      <td>Cheney</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>491</th>\n",
       "      <td>Washington</td>\n",
       "      <td>Ellensburg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>492</th>\n",
       "      <td>Washington</td>\n",
       "      <td>Pullman</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>493</th>\n",
       "      <td>Washington</td>\n",
       "      <td>University District, Seattle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>494</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Athens</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>495</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Buckhannon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>496</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Fairmont</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>497</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Glenville</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>498</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Huntington</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>499</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Montgomery</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>500</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Morgantown</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>501</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>Shepherdstown</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>502</th>\n",
       "      <td>West Virginia</td>\n",
       "      <td>West Liberty</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>503</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Appleton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>504</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Eau Claire</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>505</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Green Bay</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>506</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>La Crosse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>507</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Madison</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>508</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Menomonie</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>509</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Milwaukee</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Oshkosh</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>511</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Platteville</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>River Falls</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Stevens Point</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>514</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Waukesha</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>515</th>\n",
       "      <td>Wisconsin</td>\n",
       "      <td>Whitewater</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>516</th>\n",
       "      <td>Wyoming</td>\n",
       "      <td>Laramie</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>517 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             State                    RegionName\n",
       "0          Alabama                        Auburn\n",
       "1          Alabama                      Florence\n",
       "2          Alabama                  Jacksonville\n",
       "3          Alabama                    Livingston\n",
       "4          Alabama                    Montevallo\n",
       "5          Alabama                          Troy\n",
       "6          Alabama                    Tuscaloosa\n",
       "7          Alabama                      Tuskegee\n",
       "8           Alaska                     Fairbanks\n",
       "9          Arizona                     Flagstaff\n",
       "10         Arizona                         Tempe\n",
       "11         Arizona                        Tucson\n",
       "12        Arkansas                   Arkadelphia\n",
       "13        Arkansas                        Conway\n",
       "14        Arkansas                  Fayetteville\n",
       "15        Arkansas                     Jonesboro\n",
       "16        Arkansas                      Magnolia\n",
       "17        Arkansas                    Monticello\n",
       "18        Arkansas                  Russellville\n",
       "19        Arkansas                        Searcy\n",
       "20      California                        Angwin\n",
       "21      California                        Arcata\n",
       "22      California                      Berkeley\n",
       "23      California                         Chico\n",
       "24      California                     Claremont\n",
       "25      California                        Cotati\n",
       "26      California                         Davis\n",
       "27      California                        Irvine\n",
       "28      California                    Isla Vista\n",
       "29      California  University Park, Los Angeles\n",
       "..             ...                           ...\n",
       "487       Virginia                          Wise\n",
       "488       Virginia                    Chesapeake\n",
       "489     Washington                    Bellingham\n",
       "490     Washington                        Cheney\n",
       "491     Washington                    Ellensburg\n",
       "492     Washington                       Pullman\n",
       "493     Washington  University District, Seattle\n",
       "494  West Virginia                        Athens\n",
       "495  West Virginia                    Buckhannon\n",
       "496  West Virginia                      Fairmont\n",
       "497  West Virginia                     Glenville\n",
       "498  West Virginia                    Huntington\n",
       "499  West Virginia                    Montgomery\n",
       "500  West Virginia                    Morgantown\n",
       "501  West Virginia                 Shepherdstown\n",
       "502  West Virginia                  West Liberty\n",
       "503      Wisconsin                      Appleton\n",
       "504      Wisconsin                    Eau Claire\n",
       "505      Wisconsin                     Green Bay\n",
       "506      Wisconsin                     La Crosse\n",
       "507      Wisconsin                       Madison\n",
       "508      Wisconsin                     Menomonie\n",
       "509      Wisconsin                     Milwaukee\n",
       "510      Wisconsin                       Oshkosh\n",
       "511      Wisconsin                   Platteville\n",
       "512      Wisconsin                   River Falls\n",
       "513      Wisconsin                 Stevens Point\n",
       "514      Wisconsin                      Waukesha\n",
       "515      Wisconsin                    Whitewater\n",
       "516        Wyoming                       Laramie\n",
       "\n",
       "[517 rows x 2 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_list_of_university_towns():\n",
    "    '''Returns a DataFrame of towns and the states they are in from the \n",
    "    university_towns.txt list. The format of the DataFrame should be:\n",
    "    DataFrame( [ [\"Michigan\", \"Ann Arbor\"], [\"Michigan\", \"Yipsilanti\"] ], \n",
    "    columns=[\"State\", \"RegionName\"]  )\n",
    "    \n",
    "    The following cleaning needs to be done:\n",
    "\n",
    "    1. For \"State\", removing characters from \"[\" to the end.\n",
    "    2. For \"RegionName\", when applicable, removing every character from \" (\" to the end.\n",
    "    3. Depending on how you read the data, you may need to remove newline character '\\n'. '''\n",
    "    \n",
    "    df = pd.read_table('university_towns.txt', header = None)\n",
    "    \n",
    "    #Split State Name and University Towns\n",
    "    lst = []\n",
    "    for i in range(len(df)):\n",
    "        if '[edit]' in df.iloc[i][0]:\n",
    "            state = df.iloc[i][0]\n",
    "        if '[edit]' not in df.iloc[i][0]:\n",
    "            lst.append([state, df.iloc[i][0]])\n",
    "    \n",
    "    #Create a data frame for lst\n",
    "    towns = pd.DataFrame(lst)\n",
    "    \n",
    "    #Remove '[edit]'\n",
    "    towns[0] = towns[0].apply(lambda x : x.replace('[edit]', ''))\n",
    "    \n",
    "    #Split Region Name and (remove)University Name then expect to show Region Name ONLY\n",
    "    region=[]\n",
    "    for line in towns[1]:\n",
    "        for j in range(len(line)):\n",
    "            if line[j] == '(':\n",
    "                break\n",
    "            count = j\n",
    "        region.append(line[:count])\n",
    "    for i in range(len(towns[1])):\n",
    "        towns[1] = towns[1].replace(towns[1][i], region[i])\n",
    "            \n",
    "    towns.columns = ['State', 'RegionName']\n",
    "    \n",
    "    return towns\n",
    "\n",
    "\n",
    "get_list_of_university_towns()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "umich_part_id": "022",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2008q3'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_recession_start():\n",
    "    '''Returns the year and quarter of the recession start time as a \n",
    "    string value in a format such as 2005q3'''\n",
    "    \n",
    "    df = pd.read_excel('gdplev.xls', skiprows=219)\n",
    "    df = df[[4,6]].rename(columns={'1999q4' : 'Quarter' , 12323.3 : 'GDP'})\n",
    "\n",
    "    for i in range(len(df['GDP'])):\n",
    "        if df['GDP'][i] > df['GDP'][i+1] and df['GDP'][i+1] > df['GDP'][i+2]:\n",
    "            start = df['Quarter'][i+1]\n",
    "            break\n",
    "            \n",
    "    return start\n",
    "\n",
    "get_recession_start()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "umich_part_id": "023",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2009q4'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_recession_end():\n",
    "    '''Returns the year and quarter of the recession end time as a \n",
    "    string value in a format such as 2005q3'''\n",
    "    \n",
    "    df = pd.read_excel('gdplev.xls', skiprows=219)\n",
    "    df = df[[4,6]].rename(columns={'1999q4' : 'Quarter' , 12323.3 : 'GDP'})\n",
    "\n",
    "    for i in range(len(df['GDP'])):\n",
    "        if df['GDP'][i] > df['GDP'][i+1] and df['GDP'][i+1] > df['GDP'][i+2]:\n",
    "            index = i + 1\n",
    "            for j in range(index, len(df['GDP'])):\n",
    "                if df['GDP'][j] < df['GDP'][j+1] and df['GDP'][j+1] < df['GDP'][j+2]:\n",
    "                    return df['Quarter'][j+2]\n",
    "                   \n",
    "get_recession_end()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "umich_part_id": "024",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2009q2'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_recession_bottom():\n",
    "    '''Returns the year and quarter of the recession bottom time as a \n",
    "    string value in a format such as 2005q3'''\n",
    "    \n",
    "    df = pd.read_excel('gdplev.xls', skiprows=219)\n",
    "    df = df[[4,6]].rename(columns={'1999q4' : 'Quarter' , 12323.3 : 'GDP'})\n",
    "    \n",
    "    for i in range(len(df['GDP'])):\n",
    "        if df['GDP'][i] > df['GDP'][i+1] and df['GDP'][i+1] > df['GDP'][i+2]:\n",
    "            index = i + 1\n",
    "            start = index\n",
    "            break\n",
    "    for j in range(index, len(df['GDP'])):\n",
    "        if df['GDP'][j] < df['GDP'][j+1] and df['GDP'][j+1] < df['GDP'][j+2]:\n",
    "            end = j + 2\n",
    "            break\n",
    "    \n",
    "    min_gdp = df['GDP'][start : end].argmin()\n",
    "    \n",
    "    return df['Quarter'][min_gdp]\n",
    "\n",
    "get_recession_bottom()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "umich_part_id": "025",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>2000Q1</th>\n",
       "      <th>2000Q2</th>\n",
       "      <th>2000Q3</th>\n",
       "      <th>2000Q4</th>\n",
       "      <th>2001Q1</th>\n",
       "      <th>2001Q2</th>\n",
       "      <th>2001Q3</th>\n",
       "      <th>2001Q4</th>\n",
       "      <th>2002Q1</th>\n",
       "      <th>2002Q2</th>\n",
       "      <th>...</th>\n",
       "      <th>2014Q2</th>\n",
       "      <th>2014Q3</th>\n",
       "      <th>2014Q4</th>\n",
       "      <th>2015Q1</th>\n",
       "      <th>2015Q2</th>\n",
       "      <th>2015Q3</th>\n",
       "      <th>2015Q4</th>\n",
       "      <th>2016Q1</th>\n",
       "      <th>2016Q2</th>\n",
       "      <th>2016Q3</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>State</th>\n",
       "      <th>RegionName</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>New York</th>\n",
       "      <th>New York</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>5.154667e+05</td>\n",
       "      <td>5.228000e+05</td>\n",
       "      <td>5.280667e+05</td>\n",
       "      <td>5.322667e+05</td>\n",
       "      <td>5.408000e+05</td>\n",
       "      <td>5.572000e+05</td>\n",
       "      <td>5.728333e+05</td>\n",
       "      <td>5.828667e+05</td>\n",
       "      <td>5.916333e+05</td>\n",
       "      <td>587200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>Los Angeles</th>\n",
       "      <td>2.070667e+05</td>\n",
       "      <td>2.144667e+05</td>\n",
       "      <td>2.209667e+05</td>\n",
       "      <td>2.261667e+05</td>\n",
       "      <td>2.330000e+05</td>\n",
       "      <td>2.391000e+05</td>\n",
       "      <td>2.450667e+05</td>\n",
       "      <td>2.530333e+05</td>\n",
       "      <td>2.619667e+05</td>\n",
       "      <td>2.727000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>4.980333e+05</td>\n",
       "      <td>5.090667e+05</td>\n",
       "      <td>5.188667e+05</td>\n",
       "      <td>5.288000e+05</td>\n",
       "      <td>5.381667e+05</td>\n",
       "      <td>5.472667e+05</td>\n",
       "      <td>5.577333e+05</td>\n",
       "      <td>5.660333e+05</td>\n",
       "      <td>5.774667e+05</td>\n",
       "      <td>584050.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Illinois</th>\n",
       "      <th>Chicago</th>\n",
       "      <td>1.384000e+05</td>\n",
       "      <td>1.436333e+05</td>\n",
       "      <td>1.478667e+05</td>\n",
       "      <td>1.521333e+05</td>\n",
       "      <td>1.569333e+05</td>\n",
       "      <td>1.618000e+05</td>\n",
       "      <td>1.664000e+05</td>\n",
       "      <td>1.704333e+05</td>\n",
       "      <td>1.755000e+05</td>\n",
       "      <td>1.775667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.926333e+05</td>\n",
       "      <td>1.957667e+05</td>\n",
       "      <td>2.012667e+05</td>\n",
       "      <td>2.010667e+05</td>\n",
       "      <td>2.060333e+05</td>\n",
       "      <td>2.083000e+05</td>\n",
       "      <td>2.079000e+05</td>\n",
       "      <td>2.060667e+05</td>\n",
       "      <td>2.082000e+05</td>\n",
       "      <td>212000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pennsylvania</th>\n",
       "      <th>Philadelphia</th>\n",
       "      <td>5.300000e+04</td>\n",
       "      <td>5.363333e+04</td>\n",
       "      <td>5.413333e+04</td>\n",
       "      <td>5.470000e+04</td>\n",
       "      <td>5.533333e+04</td>\n",
       "      <td>5.553333e+04</td>\n",
       "      <td>5.626667e+04</td>\n",
       "      <td>5.753333e+04</td>\n",
       "      <td>5.913333e+04</td>\n",
       "      <td>6.073333e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.137333e+05</td>\n",
       "      <td>1.153000e+05</td>\n",
       "      <td>1.156667e+05</td>\n",
       "      <td>1.162000e+05</td>\n",
       "      <td>1.179667e+05</td>\n",
       "      <td>1.212333e+05</td>\n",
       "      <td>1.222000e+05</td>\n",
       "      <td>1.234333e+05</td>\n",
       "      <td>1.269333e+05</td>\n",
       "      <td>128700.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <th>Phoenix</th>\n",
       "      <td>1.118333e+05</td>\n",
       "      <td>1.143667e+05</td>\n",
       "      <td>1.160000e+05</td>\n",
       "      <td>1.174000e+05</td>\n",
       "      <td>1.196000e+05</td>\n",
       "      <td>1.215667e+05</td>\n",
       "      <td>1.227000e+05</td>\n",
       "      <td>1.243000e+05</td>\n",
       "      <td>1.265333e+05</td>\n",
       "      <td>1.283667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.642667e+05</td>\n",
       "      <td>1.653667e+05</td>\n",
       "      <td>1.685000e+05</td>\n",
       "      <td>1.715333e+05</td>\n",
       "      <td>1.741667e+05</td>\n",
       "      <td>1.790667e+05</td>\n",
       "      <td>1.838333e+05</td>\n",
       "      <td>1.879000e+05</td>\n",
       "      <td>1.914333e+05</td>\n",
       "      <td>195200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nevada</th>\n",
       "      <th>Las Vegas</th>\n",
       "      <td>1.326000e+05</td>\n",
       "      <td>1.343667e+05</td>\n",
       "      <td>1.354000e+05</td>\n",
       "      <td>1.370000e+05</td>\n",
       "      <td>1.395333e+05</td>\n",
       "      <td>1.417333e+05</td>\n",
       "      <td>1.433667e+05</td>\n",
       "      <td>1.461333e+05</td>\n",
       "      <td>1.493333e+05</td>\n",
       "      <td>1.509333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.700667e+05</td>\n",
       "      <td>1.734000e+05</td>\n",
       "      <td>1.754667e+05</td>\n",
       "      <td>1.775000e+05</td>\n",
       "      <td>1.816000e+05</td>\n",
       "      <td>1.867667e+05</td>\n",
       "      <td>1.906333e+05</td>\n",
       "      <td>1.946000e+05</td>\n",
       "      <td>1.972000e+05</td>\n",
       "      <td>199950.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>San Diego</th>\n",
       "      <td>2.229000e+05</td>\n",
       "      <td>2.343667e+05</td>\n",
       "      <td>2.454333e+05</td>\n",
       "      <td>2.560333e+05</td>\n",
       "      <td>2.672000e+05</td>\n",
       "      <td>2.762667e+05</td>\n",
       "      <td>2.845000e+05</td>\n",
       "      <td>2.919333e+05</td>\n",
       "      <td>3.012333e+05</td>\n",
       "      <td>3.128667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>4.802000e+05</td>\n",
       "      <td>4.890333e+05</td>\n",
       "      <td>4.964333e+05</td>\n",
       "      <td>5.033667e+05</td>\n",
       "      <td>5.120667e+05</td>\n",
       "      <td>5.197667e+05</td>\n",
       "      <td>5.254667e+05</td>\n",
       "      <td>5.293333e+05</td>\n",
       "      <td>5.362333e+05</td>\n",
       "      <td>539750.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <th>Dallas</th>\n",
       "      <td>8.446667e+04</td>\n",
       "      <td>8.386667e+04</td>\n",
       "      <td>8.486667e+04</td>\n",
       "      <td>8.783333e+04</td>\n",
       "      <td>8.973333e+04</td>\n",
       "      <td>8.930000e+04</td>\n",
       "      <td>8.906667e+04</td>\n",
       "      <td>9.090000e+04</td>\n",
       "      <td>9.256667e+04</td>\n",
       "      <td>9.380000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.066333e+05</td>\n",
       "      <td>1.089000e+05</td>\n",
       "      <td>1.115333e+05</td>\n",
       "      <td>1.137000e+05</td>\n",
       "      <td>1.211333e+05</td>\n",
       "      <td>1.285667e+05</td>\n",
       "      <td>1.346000e+05</td>\n",
       "      <td>1.405000e+05</td>\n",
       "      <td>1.446000e+05</td>\n",
       "      <td>149300.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>San Jose</th>\n",
       "      <td>3.742667e+05</td>\n",
       "      <td>4.065667e+05</td>\n",
       "      <td>4.318667e+05</td>\n",
       "      <td>4.555000e+05</td>\n",
       "      <td>4.706667e+05</td>\n",
       "      <td>4.702000e+05</td>\n",
       "      <td>4.568000e+05</td>\n",
       "      <td>4.455667e+05</td>\n",
       "      <td>4.414333e+05</td>\n",
       "      <td>4.577667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>6.794000e+05</td>\n",
       "      <td>6.970333e+05</td>\n",
       "      <td>7.149333e+05</td>\n",
       "      <td>7.314333e+05</td>\n",
       "      <td>7.567333e+05</td>\n",
       "      <td>7.764000e+05</td>\n",
       "      <td>7.891333e+05</td>\n",
       "      <td>8.036000e+05</td>\n",
       "      <td>8.189333e+05</td>\n",
       "      <td>822200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <th>Jacksonville</th>\n",
       "      <td>8.860000e+04</td>\n",
       "      <td>8.970000e+04</td>\n",
       "      <td>9.170000e+04</td>\n",
       "      <td>9.310000e+04</td>\n",
       "      <td>9.440000e+04</td>\n",
       "      <td>9.560000e+04</td>\n",
       "      <td>9.706667e+04</td>\n",
       "      <td>9.906667e+04</td>\n",
       "      <td>1.012333e+05</td>\n",
       "      <td>1.034333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.207667e+05</td>\n",
       "      <td>1.217333e+05</td>\n",
       "      <td>1.231667e+05</td>\n",
       "      <td>1.241667e+05</td>\n",
       "      <td>1.269000e+05</td>\n",
       "      <td>1.301333e+05</td>\n",
       "      <td>1.320000e+05</td>\n",
       "      <td>1.339667e+05</td>\n",
       "      <td>1.372000e+05</td>\n",
       "      <td>139900.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>San Francisco</th>\n",
       "      <td>4.305000e+05</td>\n",
       "      <td>4.644667e+05</td>\n",
       "      <td>4.835333e+05</td>\n",
       "      <td>4.930000e+05</td>\n",
       "      <td>4.940667e+05</td>\n",
       "      <td>4.961333e+05</td>\n",
       "      <td>5.041000e+05</td>\n",
       "      <td>5.134000e+05</td>\n",
       "      <td>5.204333e+05</td>\n",
       "      <td>5.381667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>9.269333e+05</td>\n",
       "      <td>9.545333e+05</td>\n",
       "      <td>9.687667e+05</td>\n",
       "      <td>1.000733e+06</td>\n",
       "      <td>1.060800e+06</td>\n",
       "      <td>1.095100e+06</td>\n",
       "      <td>1.105467e+06</td>\n",
       "      <td>1.121767e+06</td>\n",
       "      <td>1.119267e+06</td>\n",
       "      <td>1106400.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <th>Austin</th>\n",
       "      <td>1.429667e+05</td>\n",
       "      <td>1.452667e+05</td>\n",
       "      <td>1.494667e+05</td>\n",
       "      <td>1.557333e+05</td>\n",
       "      <td>1.612333e+05</td>\n",
       "      <td>1.607333e+05</td>\n",
       "      <td>1.595333e+05</td>\n",
       "      <td>1.600333e+05</td>\n",
       "      <td>1.589667e+05</td>\n",
       "      <td>1.575000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.488667e+05</td>\n",
       "      <td>2.528000e+05</td>\n",
       "      <td>2.581333e+05</td>\n",
       "      <td>2.665000e+05</td>\n",
       "      <td>2.750333e+05</td>\n",
       "      <td>2.816333e+05</td>\n",
       "      <td>2.872333e+05</td>\n",
       "      <td>2.935000e+05</td>\n",
       "      <td>3.014333e+05</td>\n",
       "      <td>304450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Michigan</th>\n",
       "      <th>Detroit</th>\n",
       "      <td>6.616667e+04</td>\n",
       "      <td>6.830000e+04</td>\n",
       "      <td>6.676667e+04</td>\n",
       "      <td>6.703333e+04</td>\n",
       "      <td>6.750000e+04</td>\n",
       "      <td>6.836667e+04</td>\n",
       "      <td>6.926667e+04</td>\n",
       "      <td>6.996667e+04</td>\n",
       "      <td>7.100000e+04</td>\n",
       "      <td>7.233333e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>3.730000e+04</td>\n",
       "      <td>3.710000e+04</td>\n",
       "      <td>3.713333e+04</td>\n",
       "      <td>3.620000e+04</td>\n",
       "      <td>3.583333e+04</td>\n",
       "      <td>3.706667e+04</td>\n",
       "      <td>3.836667e+04</td>\n",
       "      <td>3.796667e+04</td>\n",
       "      <td>3.746667e+04</td>\n",
       "      <td>37900.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Ohio</th>\n",
       "      <th>Columbus</th>\n",
       "      <td>9.436667e+04</td>\n",
       "      <td>9.583333e+04</td>\n",
       "      <td>9.713333e+04</td>\n",
       "      <td>9.826667e+04</td>\n",
       "      <td>9.940000e+04</td>\n",
       "      <td>1.002667e+05</td>\n",
       "      <td>1.010667e+05</td>\n",
       "      <td>1.022000e+05</td>\n",
       "      <td>1.034000e+05</td>\n",
       "      <td>1.048000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.031333e+05</td>\n",
       "      <td>1.045000e+05</td>\n",
       "      <td>1.064333e+05</td>\n",
       "      <td>1.078667e+05</td>\n",
       "      <td>1.094333e+05</td>\n",
       "      <td>1.115667e+05</td>\n",
       "      <td>1.150000e+05</td>\n",
       "      <td>1.167000e+05</td>\n",
       "      <td>1.182000e+05</td>\n",
       "      <td>120100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tennessee</th>\n",
       "      <th>Memphis</th>\n",
       "      <td>7.250000e+04</td>\n",
       "      <td>7.320000e+04</td>\n",
       "      <td>7.386667e+04</td>\n",
       "      <td>7.400000e+04</td>\n",
       "      <td>7.416667e+04</td>\n",
       "      <td>7.493333e+04</td>\n",
       "      <td>7.550000e+04</td>\n",
       "      <td>7.606667e+04</td>\n",
       "      <td>7.633333e+04</td>\n",
       "      <td>7.676667e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>6.810000e+04</td>\n",
       "      <td>6.910000e+04</td>\n",
       "      <td>7.116667e+04</td>\n",
       "      <td>7.053333e+04</td>\n",
       "      <td>6.870000e+04</td>\n",
       "      <td>6.866667e+04</td>\n",
       "      <td>6.953333e+04</td>\n",
       "      <td>7.090000e+04</td>\n",
       "      <td>7.416667e+04</td>\n",
       "      <td>75900.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>North Carolina</th>\n",
       "      <th>Charlotte</th>\n",
       "      <td>1.269333e+05</td>\n",
       "      <td>1.283667e+05</td>\n",
       "      <td>1.302000e+05</td>\n",
       "      <td>1.315667e+05</td>\n",
       "      <td>1.329333e+05</td>\n",
       "      <td>1.332000e+05</td>\n",
       "      <td>1.328000e+05</td>\n",
       "      <td>1.331000e+05</td>\n",
       "      <td>1.343667e+05</td>\n",
       "      <td>1.353667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.494667e+05</td>\n",
       "      <td>1.506333e+05</td>\n",
       "      <td>1.527333e+05</td>\n",
       "      <td>1.551667e+05</td>\n",
       "      <td>1.579000e+05</td>\n",
       "      <td>1.601667e+05</td>\n",
       "      <td>1.628667e+05</td>\n",
       "      <td>1.664667e+05</td>\n",
       "      <td>1.694333e+05</td>\n",
       "      <td>172400.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <th>El Paso</th>\n",
       "      <td>7.626667e+04</td>\n",
       "      <td>7.686667e+04</td>\n",
       "      <td>7.673333e+04</td>\n",
       "      <td>7.730000e+04</td>\n",
       "      <td>7.823333e+04</td>\n",
       "      <td>7.830000e+04</td>\n",
       "      <td>7.743333e+04</td>\n",
       "      <td>7.680000e+04</td>\n",
       "      <td>7.660000e+04</td>\n",
       "      <td>7.640000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.118000e+05</td>\n",
       "      <td>1.117333e+05</td>\n",
       "      <td>1.117667e+05</td>\n",
       "      <td>1.115000e+05</td>\n",
       "      <td>1.113000e+05</td>\n",
       "      <td>1.110667e+05</td>\n",
       "      <td>1.102667e+05</td>\n",
       "      <td>1.106667e+05</td>\n",
       "      <td>1.114667e+05</td>\n",
       "      <td>112200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Massachusetts</th>\n",
       "      <th>Boston</th>\n",
       "      <td>2.069333e+05</td>\n",
       "      <td>2.191667e+05</td>\n",
       "      <td>2.331000e+05</td>\n",
       "      <td>2.425000e+05</td>\n",
       "      <td>2.496000e+05</td>\n",
       "      <td>2.570667e+05</td>\n",
       "      <td>2.669333e+05</td>\n",
       "      <td>2.749667e+05</td>\n",
       "      <td>2.825000e+05</td>\n",
       "      <td>2.893000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>4.266667e+05</td>\n",
       "      <td>4.314333e+05</td>\n",
       "      <td>4.407333e+05</td>\n",
       "      <td>4.485000e+05</td>\n",
       "      <td>4.553667e+05</td>\n",
       "      <td>4.639667e+05</td>\n",
       "      <td>4.716333e+05</td>\n",
       "      <td>4.826000e+05</td>\n",
       "      <td>4.903667e+05</td>\n",
       "      <td>501700.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Washington</th>\n",
       "      <th>Seattle</th>\n",
       "      <td>2.486000e+05</td>\n",
       "      <td>2.556000e+05</td>\n",
       "      <td>2.625333e+05</td>\n",
       "      <td>2.674000e+05</td>\n",
       "      <td>2.710000e+05</td>\n",
       "      <td>2.724333e+05</td>\n",
       "      <td>2.741667e+05</td>\n",
       "      <td>2.781667e+05</td>\n",
       "      <td>2.805000e+05</td>\n",
       "      <td>2.846000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>4.418000e+05</td>\n",
       "      <td>4.515000e+05</td>\n",
       "      <td>4.591667e+05</td>\n",
       "      <td>4.679333e+05</td>\n",
       "      <td>4.933667e+05</td>\n",
       "      <td>5.142667e+05</td>\n",
       "      <td>5.334667e+05</td>\n",
       "      <td>5.517333e+05</td>\n",
       "      <td>5.755333e+05</td>\n",
       "      <td>589700.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maryland</th>\n",
       "      <th>Baltimore</th>\n",
       "      <td>5.966667e+04</td>\n",
       "      <td>5.950000e+04</td>\n",
       "      <td>5.883333e+04</td>\n",
       "      <td>5.950000e+04</td>\n",
       "      <td>5.956667e+04</td>\n",
       "      <td>6.013333e+04</td>\n",
       "      <td>6.210000e+04</td>\n",
       "      <td>6.340000e+04</td>\n",
       "      <td>6.366667e+04</td>\n",
       "      <td>6.490000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.092333e+05</td>\n",
       "      <td>1.095333e+05</td>\n",
       "      <td>1.073667e+05</td>\n",
       "      <td>1.080667e+05</td>\n",
       "      <td>1.114333e+05</td>\n",
       "      <td>1.139667e+05</td>\n",
       "      <td>1.139000e+05</td>\n",
       "      <td>1.146667e+05</td>\n",
       "      <td>1.147333e+05</td>\n",
       "      <td>115150.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Colorado</th>\n",
       "      <th>Denver</th>\n",
       "      <td>1.622333e+05</td>\n",
       "      <td>1.678333e+05</td>\n",
       "      <td>1.743333e+05</td>\n",
       "      <td>1.803333e+05</td>\n",
       "      <td>1.865000e+05</td>\n",
       "      <td>1.925333e+05</td>\n",
       "      <td>1.964000e+05</td>\n",
       "      <td>1.991000e+05</td>\n",
       "      <td>2.012333e+05</td>\n",
       "      <td>2.024333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.708667e+05</td>\n",
       "      <td>2.775000e+05</td>\n",
       "      <td>2.872333e+05</td>\n",
       "      <td>2.976333e+05</td>\n",
       "      <td>3.103667e+05</td>\n",
       "      <td>3.205000e+05</td>\n",
       "      <td>3.301000e+05</td>\n",
       "      <td>3.355667e+05</td>\n",
       "      <td>3.427667e+05</td>\n",
       "      <td>351550.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>District of Columbia</th>\n",
       "      <th>Washington</th>\n",
       "      <td>1.377667e+05</td>\n",
       "      <td>1.442000e+05</td>\n",
       "      <td>1.487000e+05</td>\n",
       "      <td>1.477000e+05</td>\n",
       "      <td>1.497667e+05</td>\n",
       "      <td>1.551333e+05</td>\n",
       "      <td>1.646333e+05</td>\n",
       "      <td>1.725333e+05</td>\n",
       "      <td>1.805000e+05</td>\n",
       "      <td>1.933000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>4.469333e+05</td>\n",
       "      <td>4.530000e+05</td>\n",
       "      <td>4.603000e+05</td>\n",
       "      <td>4.661667e+05</td>\n",
       "      <td>4.810667e+05</td>\n",
       "      <td>4.934000e+05</td>\n",
       "      <td>5.009000e+05</td>\n",
       "      <td>5.041000e+05</td>\n",
       "      <td>5.058000e+05</td>\n",
       "      <td>516250.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tennessee</th>\n",
       "      <th>Nashville</th>\n",
       "      <td>1.138333e+05</td>\n",
       "      <td>1.152667e+05</td>\n",
       "      <td>1.158667e+05</td>\n",
       "      <td>1.169333e+05</td>\n",
       "      <td>1.180333e+05</td>\n",
       "      <td>1.191667e+05</td>\n",
       "      <td>1.201000e+05</td>\n",
       "      <td>1.208000e+05</td>\n",
       "      <td>1.215667e+05</td>\n",
       "      <td>1.226333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.607000e+05</td>\n",
       "      <td>1.623000e+05</td>\n",
       "      <td>1.669000e+05</td>\n",
       "      <td>1.714667e+05</td>\n",
       "      <td>1.762667e+05</td>\n",
       "      <td>1.818000e+05</td>\n",
       "      <td>1.892000e+05</td>\n",
       "      <td>1.950667e+05</td>\n",
       "      <td>2.003667e+05</td>\n",
       "      <td>206100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>Milwaukee</th>\n",
       "      <td>7.803333e+04</td>\n",
       "      <td>7.906667e+04</td>\n",
       "      <td>8.103333e+04</td>\n",
       "      <td>8.233333e+04</td>\n",
       "      <td>8.403333e+04</td>\n",
       "      <td>8.556667e+04</td>\n",
       "      <td>8.706667e+04</td>\n",
       "      <td>8.840000e+04</td>\n",
       "      <td>8.953333e+04</td>\n",
       "      <td>9.136667e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>9.216667e+04</td>\n",
       "      <td>9.216667e+04</td>\n",
       "      <td>9.196667e+04</td>\n",
       "      <td>9.333333e+04</td>\n",
       "      <td>9.410000e+04</td>\n",
       "      <td>9.413333e+04</td>\n",
       "      <td>9.456667e+04</td>\n",
       "      <td>9.466667e+04</td>\n",
       "      <td>9.636667e+04</td>\n",
       "      <td>98850.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <th>Tucson</th>\n",
       "      <td>1.018333e+05</td>\n",
       "      <td>1.029667e+05</td>\n",
       "      <td>1.044667e+05</td>\n",
       "      <td>1.056667e+05</td>\n",
       "      <td>1.072000e+05</td>\n",
       "      <td>1.087667e+05</td>\n",
       "      <td>1.105667e+05</td>\n",
       "      <td>1.128000e+05</td>\n",
       "      <td>1.150000e+05</td>\n",
       "      <td>1.172000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.424667e+05</td>\n",
       "      <td>1.434333e+05</td>\n",
       "      <td>1.442333e+05</td>\n",
       "      <td>1.441667e+05</td>\n",
       "      <td>1.451333e+05</td>\n",
       "      <td>1.466000e+05</td>\n",
       "      <td>1.481667e+05</td>\n",
       "      <td>1.495333e+05</td>\n",
       "      <td>1.511667e+05</td>\n",
       "      <td>152700.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <th>Portland</th>\n",
       "      <td>1.528000e+05</td>\n",
       "      <td>1.547667e+05</td>\n",
       "      <td>1.565667e+05</td>\n",
       "      <td>1.574667e+05</td>\n",
       "      <td>1.599000e+05</td>\n",
       "      <td>1.618000e+05</td>\n",
       "      <td>1.642667e+05</td>\n",
       "      <td>1.677667e+05</td>\n",
       "      <td>1.707667e+05</td>\n",
       "      <td>1.741333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.822333e+05</td>\n",
       "      <td>2.872667e+05</td>\n",
       "      <td>2.955333e+05</td>\n",
       "      <td>3.019333e+05</td>\n",
       "      <td>3.119000e+05</td>\n",
       "      <td>3.257333e+05</td>\n",
       "      <td>3.430667e+05</td>\n",
       "      <td>3.560000e+05</td>\n",
       "      <td>3.698000e+05</td>\n",
       "      <td>387050.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oklahoma</th>\n",
       "      <th>Oklahoma City</th>\n",
       "      <td>7.643333e+04</td>\n",
       "      <td>7.750000e+04</td>\n",
       "      <td>7.856667e+04</td>\n",
       "      <td>7.916667e+04</td>\n",
       "      <td>7.983333e+04</td>\n",
       "      <td>8.040000e+04</td>\n",
       "      <td>8.113333e+04</td>\n",
       "      <td>8.173333e+04</td>\n",
       "      <td>8.260000e+04</td>\n",
       "      <td>8.343333e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.180333e+05</td>\n",
       "      <td>1.189667e+05</td>\n",
       "      <td>1.201000e+05</td>\n",
       "      <td>1.208000e+05</td>\n",
       "      <td>1.223667e+05</td>\n",
       "      <td>1.247000e+05</td>\n",
       "      <td>1.271000e+05</td>\n",
       "      <td>1.279000e+05</td>\n",
       "      <td>1.293000e+05</td>\n",
       "      <td>130300.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nebraska</th>\n",
       "      <th>Omaha</th>\n",
       "      <td>1.128000e+05</td>\n",
       "      <td>1.141000e+05</td>\n",
       "      <td>1.167333e+05</td>\n",
       "      <td>1.189000e+05</td>\n",
       "      <td>1.208667e+05</td>\n",
       "      <td>1.197667e+05</td>\n",
       "      <td>1.178667e+05</td>\n",
       "      <td>1.174000e+05</td>\n",
       "      <td>1.180667e+05</td>\n",
       "      <td>1.176333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.301000e+05</td>\n",
       "      <td>1.303000e+05</td>\n",
       "      <td>1.325000e+05</td>\n",
       "      <td>1.330667e+05</td>\n",
       "      <td>1.344667e+05</td>\n",
       "      <td>1.367333e+05</td>\n",
       "      <td>1.400667e+05</td>\n",
       "      <td>1.416333e+05</td>\n",
       "      <td>1.426667e+05</td>\n",
       "      <td>143450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New Mexico</th>\n",
       "      <th>Albuquerque</th>\n",
       "      <td>1.258667e+05</td>\n",
       "      <td>1.267000e+05</td>\n",
       "      <td>1.264333e+05</td>\n",
       "      <td>1.267333e+05</td>\n",
       "      <td>1.271000e+05</td>\n",
       "      <td>1.277333e+05</td>\n",
       "      <td>1.285667e+05</td>\n",
       "      <td>1.299000e+05</td>\n",
       "      <td>1.310667e+05</td>\n",
       "      <td>1.321000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.632667e+05</td>\n",
       "      <td>1.640000e+05</td>\n",
       "      <td>1.648000e+05</td>\n",
       "      <td>1.651667e+05</td>\n",
       "      <td>1.659000e+05</td>\n",
       "      <td>1.665333e+05</td>\n",
       "      <td>1.673333e+05</td>\n",
       "      <td>1.691000e+05</td>\n",
       "      <td>1.706333e+05</td>\n",
       "      <td>171900.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>Fresno</th>\n",
       "      <td>9.410000e+04</td>\n",
       "      <td>9.526667e+04</td>\n",
       "      <td>9.646667e+04</td>\n",
       "      <td>9.823333e+04</td>\n",
       "      <td>1.005667e+05</td>\n",
       "      <td>1.035667e+05</td>\n",
       "      <td>1.072333e+05</td>\n",
       "      <td>1.103000e+05</td>\n",
       "      <td>1.140333e+05</td>\n",
       "      <td>1.185333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.696333e+05</td>\n",
       "      <td>1.736000e+05</td>\n",
       "      <td>1.781333e+05</td>\n",
       "      <td>1.804667e+05</td>\n",
       "      <td>1.820333e+05</td>\n",
       "      <td>1.857000e+05</td>\n",
       "      <td>1.874667e+05</td>\n",
       "      <td>1.890333e+05</td>\n",
       "      <td>1.927333e+05</td>\n",
       "      <td>196450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <th>Granite Shoals</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.169667e+05</td>\n",
       "      <td>1.175333e+05</td>\n",
       "      <td>1.175333e+05</td>\n",
       "      <td>1.171667e+05</td>\n",
       "      <td>1.191000e+05</td>\n",
       "      <td>1.216000e+05</td>\n",
       "      <td>1.280000e+05</td>\n",
       "      <td>1.337667e+05</td>\n",
       "      <td>1.400667e+05</td>\n",
       "      <td>146450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maryland</th>\n",
       "      <th>Piney Point</th>\n",
       "      <td>1.556667e+05</td>\n",
       "      <td>1.551667e+05</td>\n",
       "      <td>1.584667e+05</td>\n",
       "      <td>1.637000e+05</td>\n",
       "      <td>1.634000e+05</td>\n",
       "      <td>1.648333e+05</td>\n",
       "      <td>1.647000e+05</td>\n",
       "      <td>1.679000e+05</td>\n",
       "      <td>1.782667e+05</td>\n",
       "      <td>1.812000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.964000e+05</td>\n",
       "      <td>3.090000e+05</td>\n",
       "      <td>3.092333e+05</td>\n",
       "      <td>3.095667e+05</td>\n",
       "      <td>3.017000e+05</td>\n",
       "      <td>3.052333e+05</td>\n",
       "      <td>3.099667e+05</td>\n",
       "      <td>3.195000e+05</td>\n",
       "      <td>3.241667e+05</td>\n",
       "      <td>324600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>Maribel</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.306000e+05</td>\n",
       "      <td>1.289667e+05</td>\n",
       "      <td>1.296333e+05</td>\n",
       "      <td>1.312667e+05</td>\n",
       "      <td>1.301333e+05</td>\n",
       "      <td>1.297333e+05</td>\n",
       "      <td>1.293000e+05</td>\n",
       "      <td>1.278333e+05</td>\n",
       "      <td>1.292667e+05</td>\n",
       "      <td>134200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Idaho</th>\n",
       "      <th>Middleton</th>\n",
       "      <td>1.060667e+05</td>\n",
       "      <td>1.043333e+05</td>\n",
       "      <td>1.019000e+05</td>\n",
       "      <td>1.041667e+05</td>\n",
       "      <td>1.061667e+05</td>\n",
       "      <td>1.083667e+05</td>\n",
       "      <td>1.110333e+05</td>\n",
       "      <td>1.112333e+05</td>\n",
       "      <td>1.141000e+05</td>\n",
       "      <td>1.141667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.443667e+05</td>\n",
       "      <td>1.457000e+05</td>\n",
       "      <td>1.462333e+05</td>\n",
       "      <td>1.461667e+05</td>\n",
       "      <td>1.477333e+05</td>\n",
       "      <td>1.482000e+05</td>\n",
       "      <td>1.511333e+05</td>\n",
       "      <td>1.539000e+05</td>\n",
       "      <td>1.571667e+05</td>\n",
       "      <td>160750.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Colorado</th>\n",
       "      <th>Bennett</th>\n",
       "      <td>1.329000e+05</td>\n",
       "      <td>1.358333e+05</td>\n",
       "      <td>1.398000e+05</td>\n",
       "      <td>1.446667e+05</td>\n",
       "      <td>1.483000e+05</td>\n",
       "      <td>1.521000e+05</td>\n",
       "      <td>1.542333e+05</td>\n",
       "      <td>1.562000e+05</td>\n",
       "      <td>1.587333e+05</td>\n",
       "      <td>1.606333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.514667e+05</td>\n",
       "      <td>1.620667e+05</td>\n",
       "      <td>1.714000e+05</td>\n",
       "      <td>1.780333e+05</td>\n",
       "      <td>1.844333e+05</td>\n",
       "      <td>1.916667e+05</td>\n",
       "      <td>1.958000e+05</td>\n",
       "      <td>1.997667e+05</td>\n",
       "      <td>2.074667e+05</td>\n",
       "      <td>212600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New Hampshire</th>\n",
       "      <th>East Hampstead</th>\n",
       "      <td>1.618333e+05</td>\n",
       "      <td>1.691000e+05</td>\n",
       "      <td>1.739667e+05</td>\n",
       "      <td>1.805000e+05</td>\n",
       "      <td>1.909000e+05</td>\n",
       "      <td>1.950667e+05</td>\n",
       "      <td>1.992667e+05</td>\n",
       "      <td>2.074000e+05</td>\n",
       "      <td>2.123000e+05</td>\n",
       "      <td>2.122333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.495000e+05</td>\n",
       "      <td>2.521000e+05</td>\n",
       "      <td>2.557333e+05</td>\n",
       "      <td>2.587333e+05</td>\n",
       "      <td>2.613667e+05</td>\n",
       "      <td>2.616000e+05</td>\n",
       "      <td>2.688000e+05</td>\n",
       "      <td>2.725333e+05</td>\n",
       "      <td>2.778000e+05</td>\n",
       "      <td>282450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Missouri</th>\n",
       "      <th>Garden City</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.055000e+05</td>\n",
       "      <td>1.043000e+05</td>\n",
       "      <td>1.047667e+05</td>\n",
       "      <td>1.060333e+05</td>\n",
       "      <td>9.606667e+04</td>\n",
       "      <td>9.930000e+04</td>\n",
       "      <td>1.034333e+05</td>\n",
       "      <td>1.062667e+05</td>\n",
       "      <td>1.116667e+05</td>\n",
       "      <td>113600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Arkansas</th>\n",
       "      <th>Mountainburg</th>\n",
       "      <td>5.716667e+04</td>\n",
       "      <td>6.433333e+04</td>\n",
       "      <td>6.783333e+04</td>\n",
       "      <td>6.900000e+04</td>\n",
       "      <td>6.866667e+04</td>\n",
       "      <td>6.386667e+04</td>\n",
       "      <td>6.376667e+04</td>\n",
       "      <td>6.546667e+04</td>\n",
       "      <td>6.533333e+04</td>\n",
       "      <td>6.600000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>8.160000e+04</td>\n",
       "      <td>8.506667e+04</td>\n",
       "      <td>8.846667e+04</td>\n",
       "      <td>8.903333e+04</td>\n",
       "      <td>8.556667e+04</td>\n",
       "      <td>8.370000e+04</td>\n",
       "      <td>9.043333e+04</td>\n",
       "      <td>9.833333e+04</td>\n",
       "      <td>1.019000e+05</td>\n",
       "      <td>103400.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>Oostburg</th>\n",
       "      <td>1.072667e+05</td>\n",
       "      <td>1.081000e+05</td>\n",
       "      <td>1.124333e+05</td>\n",
       "      <td>1.155000e+05</td>\n",
       "      <td>1.191000e+05</td>\n",
       "      <td>1.204333e+05</td>\n",
       "      <td>1.203667e+05</td>\n",
       "      <td>1.196333e+05</td>\n",
       "      <td>1.198667e+05</td>\n",
       "      <td>1.185667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.295667e+05</td>\n",
       "      <td>1.279333e+05</td>\n",
       "      <td>1.274333e+05</td>\n",
       "      <td>1.270667e+05</td>\n",
       "      <td>1.274000e+05</td>\n",
       "      <td>1.303333e+05</td>\n",
       "      <td>1.320333e+05</td>\n",
       "      <td>1.327667e+05</td>\n",
       "      <td>1.341000e+05</td>\n",
       "      <td>136350.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>Twin Peaks</th>\n",
       "      <td>9.736667e+04</td>\n",
       "      <td>1.001667e+05</td>\n",
       "      <td>1.013333e+05</td>\n",
       "      <td>1.017000e+05</td>\n",
       "      <td>1.040000e+05</td>\n",
       "      <td>1.076667e+05</td>\n",
       "      <td>1.098333e+05</td>\n",
       "      <td>1.111333e+05</td>\n",
       "      <td>1.132000e+05</td>\n",
       "      <td>1.166000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.501000e+05</td>\n",
       "      <td>1.475333e+05</td>\n",
       "      <td>1.460667e+05</td>\n",
       "      <td>1.435000e+05</td>\n",
       "      <td>1.523000e+05</td>\n",
       "      <td>1.552667e+05</td>\n",
       "      <td>1.591667e+05</td>\n",
       "      <td>1.641667e+05</td>\n",
       "      <td>1.679667e+05</td>\n",
       "      <td>173500.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New York</th>\n",
       "      <th>Upper Brookville</th>\n",
       "      <td>1.230967e+06</td>\n",
       "      <td>1.230967e+06</td>\n",
       "      <td>1.237700e+06</td>\n",
       "      <td>1.261567e+06</td>\n",
       "      <td>1.295167e+06</td>\n",
       "      <td>1.340033e+06</td>\n",
       "      <td>1.403667e+06</td>\n",
       "      <td>1.481933e+06</td>\n",
       "      <td>1.536167e+06</td>\n",
       "      <td>1.562033e+06</td>\n",
       "      <td>...</td>\n",
       "      <td>1.780633e+06</td>\n",
       "      <td>1.749233e+06</td>\n",
       "      <td>1.729467e+06</td>\n",
       "      <td>1.749867e+06</td>\n",
       "      <td>1.789600e+06</td>\n",
       "      <td>1.777267e+06</td>\n",
       "      <td>1.834367e+06</td>\n",
       "      <td>1.904500e+06</td>\n",
       "      <td>1.944067e+06</td>\n",
       "      <td>1968800.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Hawaii</th>\n",
       "      <th>Volcano</th>\n",
       "      <td>9.870000e+04</td>\n",
       "      <td>1.053667e+05</td>\n",
       "      <td>1.146667e+05</td>\n",
       "      <td>1.247667e+05</td>\n",
       "      <td>1.181333e+05</td>\n",
       "      <td>1.194000e+05</td>\n",
       "      <td>1.232667e+05</td>\n",
       "      <td>1.211667e+05</td>\n",
       "      <td>1.233000e+05</td>\n",
       "      <td>1.169000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.064667e+05</td>\n",
       "      <td>2.276333e+05</td>\n",
       "      <td>2.332000e+05</td>\n",
       "      <td>2.346333e+05</td>\n",
       "      <td>2.323667e+05</td>\n",
       "      <td>2.249667e+05</td>\n",
       "      <td>2.324333e+05</td>\n",
       "      <td>2.420667e+05</td>\n",
       "      <td>2.489667e+05</td>\n",
       "      <td>247850.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>South Carolina</th>\n",
       "      <th>Wedgefield</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>7.436667e+04</td>\n",
       "      <td>7.026667e+04</td>\n",
       "      <td>7.206667e+04</td>\n",
       "      <td>7.570000e+04</td>\n",
       "      <td>7.206667e+04</td>\n",
       "      <td>7.033333e+04</td>\n",
       "      <td>6.903333e+04</td>\n",
       "      <td>6.886667e+04</td>\n",
       "      <td>7.426667e+04</td>\n",
       "      <td>80700.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Michigan</th>\n",
       "      <th>Williamston</th>\n",
       "      <td>1.591667e+05</td>\n",
       "      <td>1.613000e+05</td>\n",
       "      <td>1.643000e+05</td>\n",
       "      <td>1.662000e+05</td>\n",
       "      <td>1.664333e+05</td>\n",
       "      <td>1.686333e+05</td>\n",
       "      <td>1.716667e+05</td>\n",
       "      <td>1.750333e+05</td>\n",
       "      <td>1.786667e+05</td>\n",
       "      <td>1.793333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.657000e+05</td>\n",
       "      <td>1.689333e+05</td>\n",
       "      <td>1.708667e+05</td>\n",
       "      <td>1.744333e+05</td>\n",
       "      <td>1.758667e+05</td>\n",
       "      <td>1.794667e+05</td>\n",
       "      <td>1.823000e+05</td>\n",
       "      <td>1.814667e+05</td>\n",
       "      <td>1.824000e+05</td>\n",
       "      <td>183000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Arkansas</th>\n",
       "      <th>Decatur</th>\n",
       "      <td>6.360000e+04</td>\n",
       "      <td>6.440000e+04</td>\n",
       "      <td>6.566667e+04</td>\n",
       "      <td>6.673333e+04</td>\n",
       "      <td>6.720000e+04</td>\n",
       "      <td>6.770000e+04</td>\n",
       "      <td>6.650000e+04</td>\n",
       "      <td>6.540000e+04</td>\n",
       "      <td>6.460000e+04</td>\n",
       "      <td>6.490000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>8.966667e+04</td>\n",
       "      <td>9.256667e+04</td>\n",
       "      <td>9.470000e+04</td>\n",
       "      <td>9.350000e+04</td>\n",
       "      <td>9.490000e+04</td>\n",
       "      <td>9.543333e+04</td>\n",
       "      <td>9.700000e+04</td>\n",
       "      <td>9.650000e+04</td>\n",
       "      <td>9.663333e+04</td>\n",
       "      <td>96850.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tennessee</th>\n",
       "      <th>Briceville</th>\n",
       "      <td>4.000000e+04</td>\n",
       "      <td>4.173333e+04</td>\n",
       "      <td>4.366667e+04</td>\n",
       "      <td>4.490000e+04</td>\n",
       "      <td>4.480000e+04</td>\n",
       "      <td>4.530000e+04</td>\n",
       "      <td>4.463333e+04</td>\n",
       "      <td>4.370000e+04</td>\n",
       "      <td>4.446667e+04</td>\n",
       "      <td>4.340000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>5.623333e+04</td>\n",
       "      <td>5.423333e+04</td>\n",
       "      <td>5.260000e+04</td>\n",
       "      <td>4.963333e+04</td>\n",
       "      <td>4.590000e+04</td>\n",
       "      <td>4.793333e+04</td>\n",
       "      <td>4.360000e+04</td>\n",
       "      <td>4.080000e+04</td>\n",
       "      <td>4.180000e+04</td>\n",
       "      <td>40850.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Indiana</th>\n",
       "      <th>Edgewood</th>\n",
       "      <td>9.170000e+04</td>\n",
       "      <td>9.186667e+04</td>\n",
       "      <td>9.293333e+04</td>\n",
       "      <td>9.490000e+04</td>\n",
       "      <td>9.893333e+04</td>\n",
       "      <td>1.000667e+05</td>\n",
       "      <td>1.008333e+05</td>\n",
       "      <td>1.010000e+05</td>\n",
       "      <td>1.021667e+05</td>\n",
       "      <td>1.017667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>9.213333e+04</td>\n",
       "      <td>9.406667e+04</td>\n",
       "      <td>9.466667e+04</td>\n",
       "      <td>9.586667e+04</td>\n",
       "      <td>9.433333e+04</td>\n",
       "      <td>9.663333e+04</td>\n",
       "      <td>9.996667e+04</td>\n",
       "      <td>9.943333e+04</td>\n",
       "      <td>9.996667e+04</td>\n",
       "      <td>100950.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tennessee</th>\n",
       "      <th>Palmyra</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.227667e+05</td>\n",
       "      <td>1.269333e+05</td>\n",
       "      <td>1.262333e+05</td>\n",
       "      <td>1.223000e+05</td>\n",
       "      <td>1.204667e+05</td>\n",
       "      <td>1.198000e+05</td>\n",
       "      <td>1.258000e+05</td>\n",
       "      <td>1.276667e+05</td>\n",
       "      <td>1.328667e+05</td>\n",
       "      <td>137750.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maryland</th>\n",
       "      <th>Saint Inigoes</th>\n",
       "      <td>1.480667e+05</td>\n",
       "      <td>1.476000e+05</td>\n",
       "      <td>1.572333e+05</td>\n",
       "      <td>1.633667e+05</td>\n",
       "      <td>1.642333e+05</td>\n",
       "      <td>1.682000e+05</td>\n",
       "      <td>1.665000e+05</td>\n",
       "      <td>1.653333e+05</td>\n",
       "      <td>1.673000e+05</td>\n",
       "      <td>1.688000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.822333e+05</td>\n",
       "      <td>2.884333e+05</td>\n",
       "      <td>2.869667e+05</td>\n",
       "      <td>2.847000e+05</td>\n",
       "      <td>2.807667e+05</td>\n",
       "      <td>2.778333e+05</td>\n",
       "      <td>2.768333e+05</td>\n",
       "      <td>2.793333e+05</td>\n",
       "      <td>2.826333e+05</td>\n",
       "      <td>281400.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Indiana</th>\n",
       "      <th>Marysville</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.166000e+05</td>\n",
       "      <td>1.151000e+05</td>\n",
       "      <td>1.165000e+05</td>\n",
       "      <td>1.118667e+05</td>\n",
       "      <td>1.118000e+05</td>\n",
       "      <td>1.156667e+05</td>\n",
       "      <td>1.201667e+05</td>\n",
       "      <td>1.282333e+05</td>\n",
       "      <td>1.232333e+05</td>\n",
       "      <td>124200.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>Forest Falls</th>\n",
       "      <td>1.135333e+05</td>\n",
       "      <td>1.144000e+05</td>\n",
       "      <td>1.141667e+05</td>\n",
       "      <td>1.111333e+05</td>\n",
       "      <td>1.134333e+05</td>\n",
       "      <td>1.130000e+05</td>\n",
       "      <td>1.130333e+05</td>\n",
       "      <td>1.151667e+05</td>\n",
       "      <td>1.187000e+05</td>\n",
       "      <td>1.250667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.653667e+05</td>\n",
       "      <td>1.675000e+05</td>\n",
       "      <td>1.771000e+05</td>\n",
       "      <td>1.765333e+05</td>\n",
       "      <td>1.818000e+05</td>\n",
       "      <td>1.911667e+05</td>\n",
       "      <td>1.987333e+05</td>\n",
       "      <td>1.886333e+05</td>\n",
       "      <td>1.898667e+05</td>\n",
       "      <td>186650.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Missouri</th>\n",
       "      <th>Bois D Arc</th>\n",
       "      <td>1.078000e+05</td>\n",
       "      <td>1.069667e+05</td>\n",
       "      <td>1.071000e+05</td>\n",
       "      <td>1.081000e+05</td>\n",
       "      <td>1.107000e+05</td>\n",
       "      <td>1.136667e+05</td>\n",
       "      <td>1.126333e+05</td>\n",
       "      <td>1.127333e+05</td>\n",
       "      <td>1.130667e+05</td>\n",
       "      <td>1.154000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.375667e+05</td>\n",
       "      <td>1.375667e+05</td>\n",
       "      <td>1.404000e+05</td>\n",
       "      <td>1.450333e+05</td>\n",
       "      <td>1.475667e+05</td>\n",
       "      <td>1.463000e+05</td>\n",
       "      <td>1.494333e+05</td>\n",
       "      <td>1.468667e+05</td>\n",
       "      <td>1.437667e+05</td>\n",
       "      <td>144000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Virginia</th>\n",
       "      <th>Henrico</th>\n",
       "      <td>1.285667e+05</td>\n",
       "      <td>1.307667e+05</td>\n",
       "      <td>1.322667e+05</td>\n",
       "      <td>1.332667e+05</td>\n",
       "      <td>1.352333e+05</td>\n",
       "      <td>1.367333e+05</td>\n",
       "      <td>1.386000e+05</td>\n",
       "      <td>1.413333e+05</td>\n",
       "      <td>1.435333e+05</td>\n",
       "      <td>1.461333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.016333e+05</td>\n",
       "      <td>2.040000e+05</td>\n",
       "      <td>2.059000e+05</td>\n",
       "      <td>2.065667e+05</td>\n",
       "      <td>2.104333e+05</td>\n",
       "      <td>2.121000e+05</td>\n",
       "      <td>2.139667e+05</td>\n",
       "      <td>2.160333e+05</td>\n",
       "      <td>2.162000e+05</td>\n",
       "      <td>220150.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New Jersey</th>\n",
       "      <th>Diamond Beach</th>\n",
       "      <td>1.739667e+05</td>\n",
       "      <td>1.831000e+05</td>\n",
       "      <td>1.889667e+05</td>\n",
       "      <td>1.931333e+05</td>\n",
       "      <td>1.944000e+05</td>\n",
       "      <td>2.102667e+05</td>\n",
       "      <td>2.302667e+05</td>\n",
       "      <td>2.486667e+05</td>\n",
       "      <td>2.599333e+05</td>\n",
       "      <td>2.656333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>3.818000e+05</td>\n",
       "      <td>3.878667e+05</td>\n",
       "      <td>3.876667e+05</td>\n",
       "      <td>3.931667e+05</td>\n",
       "      <td>3.980000e+05</td>\n",
       "      <td>3.992333e+05</td>\n",
       "      <td>4.004333e+05</td>\n",
       "      <td>4.045333e+05</td>\n",
       "      <td>4.039000e+05</td>\n",
       "      <td>399000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tennessee</th>\n",
       "      <th>Gruetli Laager</th>\n",
       "      <td>3.540000e+04</td>\n",
       "      <td>3.546667e+04</td>\n",
       "      <td>3.666667e+04</td>\n",
       "      <td>3.730000e+04</td>\n",
       "      <td>3.773333e+04</td>\n",
       "      <td>3.790000e+04</td>\n",
       "      <td>3.936667e+04</td>\n",
       "      <td>4.040000e+04</td>\n",
       "      <td>4.156667e+04</td>\n",
       "      <td>4.163333e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>5.556667e+04</td>\n",
       "      <td>5.636667e+04</td>\n",
       "      <td>5.713333e+04</td>\n",
       "      <td>5.890000e+04</td>\n",
       "      <td>6.536667e+04</td>\n",
       "      <td>6.950000e+04</td>\n",
       "      <td>7.170000e+04</td>\n",
       "      <td>7.533333e+04</td>\n",
       "      <td>7.646667e+04</td>\n",
       "      <td>77500.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>Town of Wrightstown</th>\n",
       "      <td>1.017667e+05</td>\n",
       "      <td>1.054000e+05</td>\n",
       "      <td>1.113667e+05</td>\n",
       "      <td>1.148667e+05</td>\n",
       "      <td>1.259667e+05</td>\n",
       "      <td>1.299000e+05</td>\n",
       "      <td>1.299000e+05</td>\n",
       "      <td>1.294333e+05</td>\n",
       "      <td>1.319000e+05</td>\n",
       "      <td>1.342000e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.448667e+05</td>\n",
       "      <td>1.468667e+05</td>\n",
       "      <td>1.492333e+05</td>\n",
       "      <td>1.486667e+05</td>\n",
       "      <td>1.493333e+05</td>\n",
       "      <td>1.498667e+05</td>\n",
       "      <td>1.499333e+05</td>\n",
       "      <td>1.498333e+05</td>\n",
       "      <td>1.512667e+05</td>\n",
       "      <td>155000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New York</th>\n",
       "      <th>Urbana</th>\n",
       "      <td>7.920000e+04</td>\n",
       "      <td>8.166667e+04</td>\n",
       "      <td>9.170000e+04</td>\n",
       "      <td>9.836667e+04</td>\n",
       "      <td>9.486667e+04</td>\n",
       "      <td>9.853333e+04</td>\n",
       "      <td>1.029667e+05</td>\n",
       "      <td>9.803333e+04</td>\n",
       "      <td>9.396667e+04</td>\n",
       "      <td>9.460000e+04</td>\n",
       "      <td>...</td>\n",
       "      <td>1.321333e+05</td>\n",
       "      <td>1.370333e+05</td>\n",
       "      <td>1.400667e+05</td>\n",
       "      <td>1.417000e+05</td>\n",
       "      <td>1.378667e+05</td>\n",
       "      <td>1.364667e+05</td>\n",
       "      <td>1.361667e+05</td>\n",
       "      <td>1.389667e+05</td>\n",
       "      <td>1.442000e+05</td>\n",
       "      <td>143000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>New Denmark</th>\n",
       "      <td>1.145667e+05</td>\n",
       "      <td>1.192667e+05</td>\n",
       "      <td>1.260667e+05</td>\n",
       "      <td>1.319667e+05</td>\n",
       "      <td>1.438000e+05</td>\n",
       "      <td>1.469667e+05</td>\n",
       "      <td>1.483667e+05</td>\n",
       "      <td>1.491667e+05</td>\n",
       "      <td>1.531333e+05</td>\n",
       "      <td>1.567333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>1.745667e+05</td>\n",
       "      <td>1.811667e+05</td>\n",
       "      <td>1.861667e+05</td>\n",
       "      <td>1.876000e+05</td>\n",
       "      <td>1.886667e+05</td>\n",
       "      <td>1.884333e+05</td>\n",
       "      <td>1.889333e+05</td>\n",
       "      <td>1.910667e+05</td>\n",
       "      <td>1.928333e+05</td>\n",
       "      <td>197600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <th>Angels</th>\n",
       "      <td>1.510000e+05</td>\n",
       "      <td>1.559000e+05</td>\n",
       "      <td>1.581000e+05</td>\n",
       "      <td>1.674667e+05</td>\n",
       "      <td>1.768333e+05</td>\n",
       "      <td>1.837667e+05</td>\n",
       "      <td>1.902333e+05</td>\n",
       "      <td>1.845667e+05</td>\n",
       "      <td>1.840333e+05</td>\n",
       "      <td>1.861333e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.444667e+05</td>\n",
       "      <td>2.540667e+05</td>\n",
       "      <td>2.599333e+05</td>\n",
       "      <td>2.601000e+05</td>\n",
       "      <td>2.506333e+05</td>\n",
       "      <td>2.635000e+05</td>\n",
       "      <td>2.795000e+05</td>\n",
       "      <td>2.765333e+05</td>\n",
       "      <td>2.716000e+05</td>\n",
       "      <td>269950.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wisconsin</th>\n",
       "      <th>Holland</th>\n",
       "      <td>1.510333e+05</td>\n",
       "      <td>1.505000e+05</td>\n",
       "      <td>1.532333e+05</td>\n",
       "      <td>1.558333e+05</td>\n",
       "      <td>1.618667e+05</td>\n",
       "      <td>1.657333e+05</td>\n",
       "      <td>1.680333e+05</td>\n",
       "      <td>1.674000e+05</td>\n",
       "      <td>1.657667e+05</td>\n",
       "      <td>1.619667e+05</td>\n",
       "      <td>...</td>\n",
       "      <td>2.012667e+05</td>\n",
       "      <td>2.015667e+05</td>\n",
       "      <td>2.012667e+05</td>\n",
       "      <td>2.060000e+05</td>\n",
       "      <td>2.076000e+05</td>\n",
       "      <td>2.128667e+05</td>\n",
       "      <td>2.178333e+05</td>\n",
       "      <td>2.219667e+05</td>\n",
       "      <td>2.280333e+05</td>\n",
       "      <td>234950.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10730 rows × 67 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                2000Q1        2000Q2  \\\n",
       "State                RegionName                                        \n",
       "New York             New York                      NaN           NaN   \n",
       "California           Los Angeles          2.070667e+05  2.144667e+05   \n",
       "Illinois             Chicago              1.384000e+05  1.436333e+05   \n",
       "Pennsylvania         Philadelphia         5.300000e+04  5.363333e+04   \n",
       "Arizona              Phoenix              1.118333e+05  1.143667e+05   \n",
       "Nevada               Las Vegas            1.326000e+05  1.343667e+05   \n",
       "California           San Diego            2.229000e+05  2.343667e+05   \n",
       "Texas                Dallas               8.446667e+04  8.386667e+04   \n",
       "California           San Jose             3.742667e+05  4.065667e+05   \n",
       "Florida              Jacksonville         8.860000e+04  8.970000e+04   \n",
       "California           San Francisco        4.305000e+05  4.644667e+05   \n",
       "Texas                Austin               1.429667e+05  1.452667e+05   \n",
       "Michigan             Detroit              6.616667e+04  6.830000e+04   \n",
       "Ohio                 Columbus             9.436667e+04  9.583333e+04   \n",
       "Tennessee            Memphis              7.250000e+04  7.320000e+04   \n",
       "North Carolina       Charlotte            1.269333e+05  1.283667e+05   \n",
       "Texas                El Paso              7.626667e+04  7.686667e+04   \n",
       "Massachusetts        Boston               2.069333e+05  2.191667e+05   \n",
       "Washington           Seattle              2.486000e+05  2.556000e+05   \n",
       "Maryland             Baltimore            5.966667e+04  5.950000e+04   \n",
       "Colorado             Denver               1.622333e+05  1.678333e+05   \n",
       "District of Columbia Washington           1.377667e+05  1.442000e+05   \n",
       "Tennessee            Nashville            1.138333e+05  1.152667e+05   \n",
       "Wisconsin            Milwaukee            7.803333e+04  7.906667e+04   \n",
       "Arizona              Tucson               1.018333e+05  1.029667e+05   \n",
       "Oregon               Portland             1.528000e+05  1.547667e+05   \n",
       "Oklahoma             Oklahoma City        7.643333e+04  7.750000e+04   \n",
       "Nebraska             Omaha                1.128000e+05  1.141000e+05   \n",
       "New Mexico           Albuquerque          1.258667e+05  1.267000e+05   \n",
       "California           Fresno               9.410000e+04  9.526667e+04   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals                NaN           NaN   \n",
       "Maryland             Piney Point          1.556667e+05  1.551667e+05   \n",
       "Wisconsin            Maribel                       NaN           NaN   \n",
       "Idaho                Middleton            1.060667e+05  1.043333e+05   \n",
       "Colorado             Bennett              1.329000e+05  1.358333e+05   \n",
       "New Hampshire        East Hampstead       1.618333e+05  1.691000e+05   \n",
       "Missouri             Garden City                   NaN           NaN   \n",
       "Arkansas             Mountainburg         5.716667e+04  6.433333e+04   \n",
       "Wisconsin            Oostburg             1.072667e+05  1.081000e+05   \n",
       "California           Twin Peaks           9.736667e+04  1.001667e+05   \n",
       "New York             Upper Brookville     1.230967e+06  1.230967e+06   \n",
       "Hawaii               Volcano              9.870000e+04  1.053667e+05   \n",
       "South Carolina       Wedgefield                    NaN           NaN   \n",
       "Michigan             Williamston          1.591667e+05  1.613000e+05   \n",
       "Arkansas             Decatur              6.360000e+04  6.440000e+04   \n",
       "Tennessee            Briceville           4.000000e+04  4.173333e+04   \n",
       "Indiana              Edgewood             9.170000e+04  9.186667e+04   \n",
       "Tennessee            Palmyra                       NaN           NaN   \n",
       "Maryland             Saint Inigoes        1.480667e+05  1.476000e+05   \n",
       "Indiana              Marysville                    NaN           NaN   \n",
       "California           Forest Falls         1.135333e+05  1.144000e+05   \n",
       "Missouri             Bois D Arc           1.078000e+05  1.069667e+05   \n",
       "Virginia             Henrico              1.285667e+05  1.307667e+05   \n",
       "New Jersey           Diamond Beach        1.739667e+05  1.831000e+05   \n",
       "Tennessee            Gruetli Laager       3.540000e+04  3.546667e+04   \n",
       "Wisconsin            Town of Wrightstown  1.017667e+05  1.054000e+05   \n",
       "New York             Urbana               7.920000e+04  8.166667e+04   \n",
       "Wisconsin            New Denmark          1.145667e+05  1.192667e+05   \n",
       "California           Angels               1.510000e+05  1.559000e+05   \n",
       "Wisconsin            Holland              1.510333e+05  1.505000e+05   \n",
       "\n",
       "                                                2000Q3        2000Q4  \\\n",
       "State                RegionName                                        \n",
       "New York             New York                      NaN           NaN   \n",
       "California           Los Angeles          2.209667e+05  2.261667e+05   \n",
       "Illinois             Chicago              1.478667e+05  1.521333e+05   \n",
       "Pennsylvania         Philadelphia         5.413333e+04  5.470000e+04   \n",
       "Arizona              Phoenix              1.160000e+05  1.174000e+05   \n",
       "Nevada               Las Vegas            1.354000e+05  1.370000e+05   \n",
       "California           San Diego            2.454333e+05  2.560333e+05   \n",
       "Texas                Dallas               8.486667e+04  8.783333e+04   \n",
       "California           San Jose             4.318667e+05  4.555000e+05   \n",
       "Florida              Jacksonville         9.170000e+04  9.310000e+04   \n",
       "California           San Francisco        4.835333e+05  4.930000e+05   \n",
       "Texas                Austin               1.494667e+05  1.557333e+05   \n",
       "Michigan             Detroit              6.676667e+04  6.703333e+04   \n",
       "Ohio                 Columbus             9.713333e+04  9.826667e+04   \n",
       "Tennessee            Memphis              7.386667e+04  7.400000e+04   \n",
       "North Carolina       Charlotte            1.302000e+05  1.315667e+05   \n",
       "Texas                El Paso              7.673333e+04  7.730000e+04   \n",
       "Massachusetts        Boston               2.331000e+05  2.425000e+05   \n",
       "Washington           Seattle              2.625333e+05  2.674000e+05   \n",
       "Maryland             Baltimore            5.883333e+04  5.950000e+04   \n",
       "Colorado             Denver               1.743333e+05  1.803333e+05   \n",
       "District of Columbia Washington           1.487000e+05  1.477000e+05   \n",
       "Tennessee            Nashville            1.158667e+05  1.169333e+05   \n",
       "Wisconsin            Milwaukee            8.103333e+04  8.233333e+04   \n",
       "Arizona              Tucson               1.044667e+05  1.056667e+05   \n",
       "Oregon               Portland             1.565667e+05  1.574667e+05   \n",
       "Oklahoma             Oklahoma City        7.856667e+04  7.916667e+04   \n",
       "Nebraska             Omaha                1.167333e+05  1.189000e+05   \n",
       "New Mexico           Albuquerque          1.264333e+05  1.267333e+05   \n",
       "California           Fresno               9.646667e+04  9.823333e+04   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals                NaN           NaN   \n",
       "Maryland             Piney Point          1.584667e+05  1.637000e+05   \n",
       "Wisconsin            Maribel                       NaN           NaN   \n",
       "Idaho                Middleton            1.019000e+05  1.041667e+05   \n",
       "Colorado             Bennett              1.398000e+05  1.446667e+05   \n",
       "New Hampshire        East Hampstead       1.739667e+05  1.805000e+05   \n",
       "Missouri             Garden City                   NaN           NaN   \n",
       "Arkansas             Mountainburg         6.783333e+04  6.900000e+04   \n",
       "Wisconsin            Oostburg             1.124333e+05  1.155000e+05   \n",
       "California           Twin Peaks           1.013333e+05  1.017000e+05   \n",
       "New York             Upper Brookville     1.237700e+06  1.261567e+06   \n",
       "Hawaii               Volcano              1.146667e+05  1.247667e+05   \n",
       "South Carolina       Wedgefield                    NaN           NaN   \n",
       "Michigan             Williamston          1.643000e+05  1.662000e+05   \n",
       "Arkansas             Decatur              6.566667e+04  6.673333e+04   \n",
       "Tennessee            Briceville           4.366667e+04  4.490000e+04   \n",
       "Indiana              Edgewood             9.293333e+04  9.490000e+04   \n",
       "Tennessee            Palmyra                       NaN           NaN   \n",
       "Maryland             Saint Inigoes        1.572333e+05  1.633667e+05   \n",
       "Indiana              Marysville                    NaN           NaN   \n",
       "California           Forest Falls         1.141667e+05  1.111333e+05   \n",
       "Missouri             Bois D Arc           1.071000e+05  1.081000e+05   \n",
       "Virginia             Henrico              1.322667e+05  1.332667e+05   \n",
       "New Jersey           Diamond Beach        1.889667e+05  1.931333e+05   \n",
       "Tennessee            Gruetli Laager       3.666667e+04  3.730000e+04   \n",
       "Wisconsin            Town of Wrightstown  1.113667e+05  1.148667e+05   \n",
       "New York             Urbana               9.170000e+04  9.836667e+04   \n",
       "Wisconsin            New Denmark          1.260667e+05  1.319667e+05   \n",
       "California           Angels               1.581000e+05  1.674667e+05   \n",
       "Wisconsin            Holland              1.532333e+05  1.558333e+05   \n",
       "\n",
       "                                                2001Q1        2001Q2  \\\n",
       "State                RegionName                                        \n",
       "New York             New York                      NaN           NaN   \n",
       "California           Los Angeles          2.330000e+05  2.391000e+05   \n",
       "Illinois             Chicago              1.569333e+05  1.618000e+05   \n",
       "Pennsylvania         Philadelphia         5.533333e+04  5.553333e+04   \n",
       "Arizona              Phoenix              1.196000e+05  1.215667e+05   \n",
       "Nevada               Las Vegas            1.395333e+05  1.417333e+05   \n",
       "California           San Diego            2.672000e+05  2.762667e+05   \n",
       "Texas                Dallas               8.973333e+04  8.930000e+04   \n",
       "California           San Jose             4.706667e+05  4.702000e+05   \n",
       "Florida              Jacksonville         9.440000e+04  9.560000e+04   \n",
       "California           San Francisco        4.940667e+05  4.961333e+05   \n",
       "Texas                Austin               1.612333e+05  1.607333e+05   \n",
       "Michigan             Detroit              6.750000e+04  6.836667e+04   \n",
       "Ohio                 Columbus             9.940000e+04  1.002667e+05   \n",
       "Tennessee            Memphis              7.416667e+04  7.493333e+04   \n",
       "North Carolina       Charlotte            1.329333e+05  1.332000e+05   \n",
       "Texas                El Paso              7.823333e+04  7.830000e+04   \n",
       "Massachusetts        Boston               2.496000e+05  2.570667e+05   \n",
       "Washington           Seattle              2.710000e+05  2.724333e+05   \n",
       "Maryland             Baltimore            5.956667e+04  6.013333e+04   \n",
       "Colorado             Denver               1.865000e+05  1.925333e+05   \n",
       "District of Columbia Washington           1.497667e+05  1.551333e+05   \n",
       "Tennessee            Nashville            1.180333e+05  1.191667e+05   \n",
       "Wisconsin            Milwaukee            8.403333e+04  8.556667e+04   \n",
       "Arizona              Tucson               1.072000e+05  1.087667e+05   \n",
       "Oregon               Portland             1.599000e+05  1.618000e+05   \n",
       "Oklahoma             Oklahoma City        7.983333e+04  8.040000e+04   \n",
       "Nebraska             Omaha                1.208667e+05  1.197667e+05   \n",
       "New Mexico           Albuquerque          1.271000e+05  1.277333e+05   \n",
       "California           Fresno               1.005667e+05  1.035667e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals                NaN           NaN   \n",
       "Maryland             Piney Point          1.634000e+05  1.648333e+05   \n",
       "Wisconsin            Maribel                       NaN           NaN   \n",
       "Idaho                Middleton            1.061667e+05  1.083667e+05   \n",
       "Colorado             Bennett              1.483000e+05  1.521000e+05   \n",
       "New Hampshire        East Hampstead       1.909000e+05  1.950667e+05   \n",
       "Missouri             Garden City                   NaN           NaN   \n",
       "Arkansas             Mountainburg         6.866667e+04  6.386667e+04   \n",
       "Wisconsin            Oostburg             1.191000e+05  1.204333e+05   \n",
       "California           Twin Peaks           1.040000e+05  1.076667e+05   \n",
       "New York             Upper Brookville     1.295167e+06  1.340033e+06   \n",
       "Hawaii               Volcano              1.181333e+05  1.194000e+05   \n",
       "South Carolina       Wedgefield                    NaN           NaN   \n",
       "Michigan             Williamston          1.664333e+05  1.686333e+05   \n",
       "Arkansas             Decatur              6.720000e+04  6.770000e+04   \n",
       "Tennessee            Briceville           4.480000e+04  4.530000e+04   \n",
       "Indiana              Edgewood             9.893333e+04  1.000667e+05   \n",
       "Tennessee            Palmyra                       NaN           NaN   \n",
       "Maryland             Saint Inigoes        1.642333e+05  1.682000e+05   \n",
       "Indiana              Marysville                    NaN           NaN   \n",
       "California           Forest Falls         1.134333e+05  1.130000e+05   \n",
       "Missouri             Bois D Arc           1.107000e+05  1.136667e+05   \n",
       "Virginia             Henrico              1.352333e+05  1.367333e+05   \n",
       "New Jersey           Diamond Beach        1.944000e+05  2.102667e+05   \n",
       "Tennessee            Gruetli Laager       3.773333e+04  3.790000e+04   \n",
       "Wisconsin            Town of Wrightstown  1.259667e+05  1.299000e+05   \n",
       "New York             Urbana               9.486667e+04  9.853333e+04   \n",
       "Wisconsin            New Denmark          1.438000e+05  1.469667e+05   \n",
       "California           Angels               1.768333e+05  1.837667e+05   \n",
       "Wisconsin            Holland              1.618667e+05  1.657333e+05   \n",
       "\n",
       "                                                2001Q3        2001Q4  \\\n",
       "State                RegionName                                        \n",
       "New York             New York                      NaN           NaN   \n",
       "California           Los Angeles          2.450667e+05  2.530333e+05   \n",
       "Illinois             Chicago              1.664000e+05  1.704333e+05   \n",
       "Pennsylvania         Philadelphia         5.626667e+04  5.753333e+04   \n",
       "Arizona              Phoenix              1.227000e+05  1.243000e+05   \n",
       "Nevada               Las Vegas            1.433667e+05  1.461333e+05   \n",
       "California           San Diego            2.845000e+05  2.919333e+05   \n",
       "Texas                Dallas               8.906667e+04  9.090000e+04   \n",
       "California           San Jose             4.568000e+05  4.455667e+05   \n",
       "Florida              Jacksonville         9.706667e+04  9.906667e+04   \n",
       "California           San Francisco        5.041000e+05  5.134000e+05   \n",
       "Texas                Austin               1.595333e+05  1.600333e+05   \n",
       "Michigan             Detroit              6.926667e+04  6.996667e+04   \n",
       "Ohio                 Columbus             1.010667e+05  1.022000e+05   \n",
       "Tennessee            Memphis              7.550000e+04  7.606667e+04   \n",
       "North Carolina       Charlotte            1.328000e+05  1.331000e+05   \n",
       "Texas                El Paso              7.743333e+04  7.680000e+04   \n",
       "Massachusetts        Boston               2.669333e+05  2.749667e+05   \n",
       "Washington           Seattle              2.741667e+05  2.781667e+05   \n",
       "Maryland             Baltimore            6.210000e+04  6.340000e+04   \n",
       "Colorado             Denver               1.964000e+05  1.991000e+05   \n",
       "District of Columbia Washington           1.646333e+05  1.725333e+05   \n",
       "Tennessee            Nashville            1.201000e+05  1.208000e+05   \n",
       "Wisconsin            Milwaukee            8.706667e+04  8.840000e+04   \n",
       "Arizona              Tucson               1.105667e+05  1.128000e+05   \n",
       "Oregon               Portland             1.642667e+05  1.677667e+05   \n",
       "Oklahoma             Oklahoma City        8.113333e+04  8.173333e+04   \n",
       "Nebraska             Omaha                1.178667e+05  1.174000e+05   \n",
       "New Mexico           Albuquerque          1.285667e+05  1.299000e+05   \n",
       "California           Fresno               1.072333e+05  1.103000e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals                NaN           NaN   \n",
       "Maryland             Piney Point          1.647000e+05  1.679000e+05   \n",
       "Wisconsin            Maribel                       NaN           NaN   \n",
       "Idaho                Middleton            1.110333e+05  1.112333e+05   \n",
       "Colorado             Bennett              1.542333e+05  1.562000e+05   \n",
       "New Hampshire        East Hampstead       1.992667e+05  2.074000e+05   \n",
       "Missouri             Garden City                   NaN           NaN   \n",
       "Arkansas             Mountainburg         6.376667e+04  6.546667e+04   \n",
       "Wisconsin            Oostburg             1.203667e+05  1.196333e+05   \n",
       "California           Twin Peaks           1.098333e+05  1.111333e+05   \n",
       "New York             Upper Brookville     1.403667e+06  1.481933e+06   \n",
       "Hawaii               Volcano              1.232667e+05  1.211667e+05   \n",
       "South Carolina       Wedgefield                    NaN           NaN   \n",
       "Michigan             Williamston          1.716667e+05  1.750333e+05   \n",
       "Arkansas             Decatur              6.650000e+04  6.540000e+04   \n",
       "Tennessee            Briceville           4.463333e+04  4.370000e+04   \n",
       "Indiana              Edgewood             1.008333e+05  1.010000e+05   \n",
       "Tennessee            Palmyra                       NaN           NaN   \n",
       "Maryland             Saint Inigoes        1.665000e+05  1.653333e+05   \n",
       "Indiana              Marysville                    NaN           NaN   \n",
       "California           Forest Falls         1.130333e+05  1.151667e+05   \n",
       "Missouri             Bois D Arc           1.126333e+05  1.127333e+05   \n",
       "Virginia             Henrico              1.386000e+05  1.413333e+05   \n",
       "New Jersey           Diamond Beach        2.302667e+05  2.486667e+05   \n",
       "Tennessee            Gruetli Laager       3.936667e+04  4.040000e+04   \n",
       "Wisconsin            Town of Wrightstown  1.299000e+05  1.294333e+05   \n",
       "New York             Urbana               1.029667e+05  9.803333e+04   \n",
       "Wisconsin            New Denmark          1.483667e+05  1.491667e+05   \n",
       "California           Angels               1.902333e+05  1.845667e+05   \n",
       "Wisconsin            Holland              1.680333e+05  1.674000e+05   \n",
       "\n",
       "                                                2002Q1        2002Q2  \\\n",
       "State                RegionName                                        \n",
       "New York             New York                      NaN           NaN   \n",
       "California           Los Angeles          2.619667e+05  2.727000e+05   \n",
       "Illinois             Chicago              1.755000e+05  1.775667e+05   \n",
       "Pennsylvania         Philadelphia         5.913333e+04  6.073333e+04   \n",
       "Arizona              Phoenix              1.265333e+05  1.283667e+05   \n",
       "Nevada               Las Vegas            1.493333e+05  1.509333e+05   \n",
       "California           San Diego            3.012333e+05  3.128667e+05   \n",
       "Texas                Dallas               9.256667e+04  9.380000e+04   \n",
       "California           San Jose             4.414333e+05  4.577667e+05   \n",
       "Florida              Jacksonville         1.012333e+05  1.034333e+05   \n",
       "California           San Francisco        5.204333e+05  5.381667e+05   \n",
       "Texas                Austin               1.589667e+05  1.575000e+05   \n",
       "Michigan             Detroit              7.100000e+04  7.233333e+04   \n",
       "Ohio                 Columbus             1.034000e+05  1.048000e+05   \n",
       "Tennessee            Memphis              7.633333e+04  7.676667e+04   \n",
       "North Carolina       Charlotte            1.343667e+05  1.353667e+05   \n",
       "Texas                El Paso              7.660000e+04  7.640000e+04   \n",
       "Massachusetts        Boston               2.825000e+05  2.893000e+05   \n",
       "Washington           Seattle              2.805000e+05  2.846000e+05   \n",
       "Maryland             Baltimore            6.366667e+04  6.490000e+04   \n",
       "Colorado             Denver               2.012333e+05  2.024333e+05   \n",
       "District of Columbia Washington           1.805000e+05  1.933000e+05   \n",
       "Tennessee            Nashville            1.215667e+05  1.226333e+05   \n",
       "Wisconsin            Milwaukee            8.953333e+04  9.136667e+04   \n",
       "Arizona              Tucson               1.150000e+05  1.172000e+05   \n",
       "Oregon               Portland             1.707667e+05  1.741333e+05   \n",
       "Oklahoma             Oklahoma City        8.260000e+04  8.343333e+04   \n",
       "Nebraska             Omaha                1.180667e+05  1.176333e+05   \n",
       "New Mexico           Albuquerque          1.310667e+05  1.321000e+05   \n",
       "California           Fresno               1.140333e+05  1.185333e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals                NaN           NaN   \n",
       "Maryland             Piney Point          1.782667e+05  1.812000e+05   \n",
       "Wisconsin            Maribel                       NaN           NaN   \n",
       "Idaho                Middleton            1.141000e+05  1.141667e+05   \n",
       "Colorado             Bennett              1.587333e+05  1.606333e+05   \n",
       "New Hampshire        East Hampstead       2.123000e+05  2.122333e+05   \n",
       "Missouri             Garden City                   NaN           NaN   \n",
       "Arkansas             Mountainburg         6.533333e+04  6.600000e+04   \n",
       "Wisconsin            Oostburg             1.198667e+05  1.185667e+05   \n",
       "California           Twin Peaks           1.132000e+05  1.166000e+05   \n",
       "New York             Upper Brookville     1.536167e+06  1.562033e+06   \n",
       "Hawaii               Volcano              1.233000e+05  1.169000e+05   \n",
       "South Carolina       Wedgefield                    NaN           NaN   \n",
       "Michigan             Williamston          1.786667e+05  1.793333e+05   \n",
       "Arkansas             Decatur              6.460000e+04  6.490000e+04   \n",
       "Tennessee            Briceville           4.446667e+04  4.340000e+04   \n",
       "Indiana              Edgewood             1.021667e+05  1.017667e+05   \n",
       "Tennessee            Palmyra                       NaN           NaN   \n",
       "Maryland             Saint Inigoes        1.673000e+05  1.688000e+05   \n",
       "Indiana              Marysville                    NaN           NaN   \n",
       "California           Forest Falls         1.187000e+05  1.250667e+05   \n",
       "Missouri             Bois D Arc           1.130667e+05  1.154000e+05   \n",
       "Virginia             Henrico              1.435333e+05  1.461333e+05   \n",
       "New Jersey           Diamond Beach        2.599333e+05  2.656333e+05   \n",
       "Tennessee            Gruetli Laager       4.156667e+04  4.163333e+04   \n",
       "Wisconsin            Town of Wrightstown  1.319000e+05  1.342000e+05   \n",
       "New York             Urbana               9.396667e+04  9.460000e+04   \n",
       "Wisconsin            New Denmark          1.531333e+05  1.567333e+05   \n",
       "California           Angels               1.840333e+05  1.861333e+05   \n",
       "Wisconsin            Holland              1.657667e+05  1.619667e+05   \n",
       "\n",
       "                                            ...            2014Q2  \\\n",
       "State                RegionName             ...                     \n",
       "New York             New York               ...      5.154667e+05   \n",
       "California           Los Angeles            ...      4.980333e+05   \n",
       "Illinois             Chicago                ...      1.926333e+05   \n",
       "Pennsylvania         Philadelphia           ...      1.137333e+05   \n",
       "Arizona              Phoenix                ...      1.642667e+05   \n",
       "Nevada               Las Vegas              ...      1.700667e+05   \n",
       "California           San Diego              ...      4.802000e+05   \n",
       "Texas                Dallas                 ...      1.066333e+05   \n",
       "California           San Jose               ...      6.794000e+05   \n",
       "Florida              Jacksonville           ...      1.207667e+05   \n",
       "California           San Francisco          ...      9.269333e+05   \n",
       "Texas                Austin                 ...      2.488667e+05   \n",
       "Michigan             Detroit                ...      3.730000e+04   \n",
       "Ohio                 Columbus               ...      1.031333e+05   \n",
       "Tennessee            Memphis                ...      6.810000e+04   \n",
       "North Carolina       Charlotte              ...      1.494667e+05   \n",
       "Texas                El Paso                ...      1.118000e+05   \n",
       "Massachusetts        Boston                 ...      4.266667e+05   \n",
       "Washington           Seattle                ...      4.418000e+05   \n",
       "Maryland             Baltimore              ...      1.092333e+05   \n",
       "Colorado             Denver                 ...      2.708667e+05   \n",
       "District of Columbia Washington             ...      4.469333e+05   \n",
       "Tennessee            Nashville              ...      1.607000e+05   \n",
       "Wisconsin            Milwaukee              ...      9.216667e+04   \n",
       "Arizona              Tucson                 ...      1.424667e+05   \n",
       "Oregon               Portland               ...      2.822333e+05   \n",
       "Oklahoma             Oklahoma City          ...      1.180333e+05   \n",
       "Nebraska             Omaha                  ...      1.301000e+05   \n",
       "New Mexico           Albuquerque            ...      1.632667e+05   \n",
       "California           Fresno                 ...      1.696333e+05   \n",
       "...                                         ...               ...   \n",
       "Texas                Granite Shoals         ...      1.169667e+05   \n",
       "Maryland             Piney Point            ...      2.964000e+05   \n",
       "Wisconsin            Maribel                ...      1.306000e+05   \n",
       "Idaho                Middleton              ...      1.443667e+05   \n",
       "Colorado             Bennett                ...      1.514667e+05   \n",
       "New Hampshire        East Hampstead         ...      2.495000e+05   \n",
       "Missouri             Garden City            ...      1.055000e+05   \n",
       "Arkansas             Mountainburg           ...      8.160000e+04   \n",
       "Wisconsin            Oostburg               ...      1.295667e+05   \n",
       "California           Twin Peaks             ...      1.501000e+05   \n",
       "New York             Upper Brookville       ...      1.780633e+06   \n",
       "Hawaii               Volcano                ...      2.064667e+05   \n",
       "South Carolina       Wedgefield             ...      7.436667e+04   \n",
       "Michigan             Williamston            ...      1.657000e+05   \n",
       "Arkansas             Decatur                ...      8.966667e+04   \n",
       "Tennessee            Briceville             ...      5.623333e+04   \n",
       "Indiana              Edgewood               ...      9.213333e+04   \n",
       "Tennessee            Palmyra                ...      1.227667e+05   \n",
       "Maryland             Saint Inigoes          ...      2.822333e+05   \n",
       "Indiana              Marysville             ...      1.166000e+05   \n",
       "California           Forest Falls           ...      1.653667e+05   \n",
       "Missouri             Bois D Arc             ...      1.375667e+05   \n",
       "Virginia             Henrico                ...      2.016333e+05   \n",
       "New Jersey           Diamond Beach          ...      3.818000e+05   \n",
       "Tennessee            Gruetli Laager         ...      5.556667e+04   \n",
       "Wisconsin            Town of Wrightstown    ...      1.448667e+05   \n",
       "New York             Urbana                 ...      1.321333e+05   \n",
       "Wisconsin            New Denmark            ...      1.745667e+05   \n",
       "California           Angels                 ...      2.444667e+05   \n",
       "Wisconsin            Holland                ...      2.012667e+05   \n",
       "\n",
       "                                                2014Q3        2014Q4  \\\n",
       "State                RegionName                                        \n",
       "New York             New York             5.228000e+05  5.280667e+05   \n",
       "California           Los Angeles          5.090667e+05  5.188667e+05   \n",
       "Illinois             Chicago              1.957667e+05  2.012667e+05   \n",
       "Pennsylvania         Philadelphia         1.153000e+05  1.156667e+05   \n",
       "Arizona              Phoenix              1.653667e+05  1.685000e+05   \n",
       "Nevada               Las Vegas            1.734000e+05  1.754667e+05   \n",
       "California           San Diego            4.890333e+05  4.964333e+05   \n",
       "Texas                Dallas               1.089000e+05  1.115333e+05   \n",
       "California           San Jose             6.970333e+05  7.149333e+05   \n",
       "Florida              Jacksonville         1.217333e+05  1.231667e+05   \n",
       "California           San Francisco        9.545333e+05  9.687667e+05   \n",
       "Texas                Austin               2.528000e+05  2.581333e+05   \n",
       "Michigan             Detroit              3.710000e+04  3.713333e+04   \n",
       "Ohio                 Columbus             1.045000e+05  1.064333e+05   \n",
       "Tennessee            Memphis              6.910000e+04  7.116667e+04   \n",
       "North Carolina       Charlotte            1.506333e+05  1.527333e+05   \n",
       "Texas                El Paso              1.117333e+05  1.117667e+05   \n",
       "Massachusetts        Boston               4.314333e+05  4.407333e+05   \n",
       "Washington           Seattle              4.515000e+05  4.591667e+05   \n",
       "Maryland             Baltimore            1.095333e+05  1.073667e+05   \n",
       "Colorado             Denver               2.775000e+05  2.872333e+05   \n",
       "District of Columbia Washington           4.530000e+05  4.603000e+05   \n",
       "Tennessee            Nashville            1.623000e+05  1.669000e+05   \n",
       "Wisconsin            Milwaukee            9.216667e+04  9.196667e+04   \n",
       "Arizona              Tucson               1.434333e+05  1.442333e+05   \n",
       "Oregon               Portland             2.872667e+05  2.955333e+05   \n",
       "Oklahoma             Oklahoma City        1.189667e+05  1.201000e+05   \n",
       "Nebraska             Omaha                1.303000e+05  1.325000e+05   \n",
       "New Mexico           Albuquerque          1.640000e+05  1.648000e+05   \n",
       "California           Fresno               1.736000e+05  1.781333e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals       1.175333e+05  1.175333e+05   \n",
       "Maryland             Piney Point          3.090000e+05  3.092333e+05   \n",
       "Wisconsin            Maribel              1.289667e+05  1.296333e+05   \n",
       "Idaho                Middleton            1.457000e+05  1.462333e+05   \n",
       "Colorado             Bennett              1.620667e+05  1.714000e+05   \n",
       "New Hampshire        East Hampstead       2.521000e+05  2.557333e+05   \n",
       "Missouri             Garden City          1.043000e+05  1.047667e+05   \n",
       "Arkansas             Mountainburg         8.506667e+04  8.846667e+04   \n",
       "Wisconsin            Oostburg             1.279333e+05  1.274333e+05   \n",
       "California           Twin Peaks           1.475333e+05  1.460667e+05   \n",
       "New York             Upper Brookville     1.749233e+06  1.729467e+06   \n",
       "Hawaii               Volcano              2.276333e+05  2.332000e+05   \n",
       "South Carolina       Wedgefield           7.026667e+04  7.206667e+04   \n",
       "Michigan             Williamston          1.689333e+05  1.708667e+05   \n",
       "Arkansas             Decatur              9.256667e+04  9.470000e+04   \n",
       "Tennessee            Briceville           5.423333e+04  5.260000e+04   \n",
       "Indiana              Edgewood             9.406667e+04  9.466667e+04   \n",
       "Tennessee            Palmyra              1.269333e+05  1.262333e+05   \n",
       "Maryland             Saint Inigoes        2.884333e+05  2.869667e+05   \n",
       "Indiana              Marysville           1.151000e+05  1.165000e+05   \n",
       "California           Forest Falls         1.675000e+05  1.771000e+05   \n",
       "Missouri             Bois D Arc           1.375667e+05  1.404000e+05   \n",
       "Virginia             Henrico              2.040000e+05  2.059000e+05   \n",
       "New Jersey           Diamond Beach        3.878667e+05  3.876667e+05   \n",
       "Tennessee            Gruetli Laager       5.636667e+04  5.713333e+04   \n",
       "Wisconsin            Town of Wrightstown  1.468667e+05  1.492333e+05   \n",
       "New York             Urbana               1.370333e+05  1.400667e+05   \n",
       "Wisconsin            New Denmark          1.811667e+05  1.861667e+05   \n",
       "California           Angels               2.540667e+05  2.599333e+05   \n",
       "Wisconsin            Holland              2.015667e+05  2.012667e+05   \n",
       "\n",
       "                                                2015Q1        2015Q2  \\\n",
       "State                RegionName                                        \n",
       "New York             New York             5.322667e+05  5.408000e+05   \n",
       "California           Los Angeles          5.288000e+05  5.381667e+05   \n",
       "Illinois             Chicago              2.010667e+05  2.060333e+05   \n",
       "Pennsylvania         Philadelphia         1.162000e+05  1.179667e+05   \n",
       "Arizona              Phoenix              1.715333e+05  1.741667e+05   \n",
       "Nevada               Las Vegas            1.775000e+05  1.816000e+05   \n",
       "California           San Diego            5.033667e+05  5.120667e+05   \n",
       "Texas                Dallas               1.137000e+05  1.211333e+05   \n",
       "California           San Jose             7.314333e+05  7.567333e+05   \n",
       "Florida              Jacksonville         1.241667e+05  1.269000e+05   \n",
       "California           San Francisco        1.000733e+06  1.060800e+06   \n",
       "Texas                Austin               2.665000e+05  2.750333e+05   \n",
       "Michigan             Detroit              3.620000e+04  3.583333e+04   \n",
       "Ohio                 Columbus             1.078667e+05  1.094333e+05   \n",
       "Tennessee            Memphis              7.053333e+04  6.870000e+04   \n",
       "North Carolina       Charlotte            1.551667e+05  1.579000e+05   \n",
       "Texas                El Paso              1.115000e+05  1.113000e+05   \n",
       "Massachusetts        Boston               4.485000e+05  4.553667e+05   \n",
       "Washington           Seattle              4.679333e+05  4.933667e+05   \n",
       "Maryland             Baltimore            1.080667e+05  1.114333e+05   \n",
       "Colorado             Denver               2.976333e+05  3.103667e+05   \n",
       "District of Columbia Washington           4.661667e+05  4.810667e+05   \n",
       "Tennessee            Nashville            1.714667e+05  1.762667e+05   \n",
       "Wisconsin            Milwaukee            9.333333e+04  9.410000e+04   \n",
       "Arizona              Tucson               1.441667e+05  1.451333e+05   \n",
       "Oregon               Portland             3.019333e+05  3.119000e+05   \n",
       "Oklahoma             Oklahoma City        1.208000e+05  1.223667e+05   \n",
       "Nebraska             Omaha                1.330667e+05  1.344667e+05   \n",
       "New Mexico           Albuquerque          1.651667e+05  1.659000e+05   \n",
       "California           Fresno               1.804667e+05  1.820333e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals       1.171667e+05  1.191000e+05   \n",
       "Maryland             Piney Point          3.095667e+05  3.017000e+05   \n",
       "Wisconsin            Maribel              1.312667e+05  1.301333e+05   \n",
       "Idaho                Middleton            1.461667e+05  1.477333e+05   \n",
       "Colorado             Bennett              1.780333e+05  1.844333e+05   \n",
       "New Hampshire        East Hampstead       2.587333e+05  2.613667e+05   \n",
       "Missouri             Garden City          1.060333e+05  9.606667e+04   \n",
       "Arkansas             Mountainburg         8.903333e+04  8.556667e+04   \n",
       "Wisconsin            Oostburg             1.270667e+05  1.274000e+05   \n",
       "California           Twin Peaks           1.435000e+05  1.523000e+05   \n",
       "New York             Upper Brookville     1.749867e+06  1.789600e+06   \n",
       "Hawaii               Volcano              2.346333e+05  2.323667e+05   \n",
       "South Carolina       Wedgefield           7.570000e+04  7.206667e+04   \n",
       "Michigan             Williamston          1.744333e+05  1.758667e+05   \n",
       "Arkansas             Decatur              9.350000e+04  9.490000e+04   \n",
       "Tennessee            Briceville           4.963333e+04  4.590000e+04   \n",
       "Indiana              Edgewood             9.586667e+04  9.433333e+04   \n",
       "Tennessee            Palmyra              1.223000e+05  1.204667e+05   \n",
       "Maryland             Saint Inigoes        2.847000e+05  2.807667e+05   \n",
       "Indiana              Marysville           1.118667e+05  1.118000e+05   \n",
       "California           Forest Falls         1.765333e+05  1.818000e+05   \n",
       "Missouri             Bois D Arc           1.450333e+05  1.475667e+05   \n",
       "Virginia             Henrico              2.065667e+05  2.104333e+05   \n",
       "New Jersey           Diamond Beach        3.931667e+05  3.980000e+05   \n",
       "Tennessee            Gruetli Laager       5.890000e+04  6.536667e+04   \n",
       "Wisconsin            Town of Wrightstown  1.486667e+05  1.493333e+05   \n",
       "New York             Urbana               1.417000e+05  1.378667e+05   \n",
       "Wisconsin            New Denmark          1.876000e+05  1.886667e+05   \n",
       "California           Angels               2.601000e+05  2.506333e+05   \n",
       "Wisconsin            Holland              2.060000e+05  2.076000e+05   \n",
       "\n",
       "                                                2015Q3        2015Q4  \\\n",
       "State                RegionName                                        \n",
       "New York             New York             5.572000e+05  5.728333e+05   \n",
       "California           Los Angeles          5.472667e+05  5.577333e+05   \n",
       "Illinois             Chicago              2.083000e+05  2.079000e+05   \n",
       "Pennsylvania         Philadelphia         1.212333e+05  1.222000e+05   \n",
       "Arizona              Phoenix              1.790667e+05  1.838333e+05   \n",
       "Nevada               Las Vegas            1.867667e+05  1.906333e+05   \n",
       "California           San Diego            5.197667e+05  5.254667e+05   \n",
       "Texas                Dallas               1.285667e+05  1.346000e+05   \n",
       "California           San Jose             7.764000e+05  7.891333e+05   \n",
       "Florida              Jacksonville         1.301333e+05  1.320000e+05   \n",
       "California           San Francisco        1.095100e+06  1.105467e+06   \n",
       "Texas                Austin               2.816333e+05  2.872333e+05   \n",
       "Michigan             Detroit              3.706667e+04  3.836667e+04   \n",
       "Ohio                 Columbus             1.115667e+05  1.150000e+05   \n",
       "Tennessee            Memphis              6.866667e+04  6.953333e+04   \n",
       "North Carolina       Charlotte            1.601667e+05  1.628667e+05   \n",
       "Texas                El Paso              1.110667e+05  1.102667e+05   \n",
       "Massachusetts        Boston               4.639667e+05  4.716333e+05   \n",
       "Washington           Seattle              5.142667e+05  5.334667e+05   \n",
       "Maryland             Baltimore            1.139667e+05  1.139000e+05   \n",
       "Colorado             Denver               3.205000e+05  3.301000e+05   \n",
       "District of Columbia Washington           4.934000e+05  5.009000e+05   \n",
       "Tennessee            Nashville            1.818000e+05  1.892000e+05   \n",
       "Wisconsin            Milwaukee            9.413333e+04  9.456667e+04   \n",
       "Arizona              Tucson               1.466000e+05  1.481667e+05   \n",
       "Oregon               Portland             3.257333e+05  3.430667e+05   \n",
       "Oklahoma             Oklahoma City        1.247000e+05  1.271000e+05   \n",
       "Nebraska             Omaha                1.367333e+05  1.400667e+05   \n",
       "New Mexico           Albuquerque          1.665333e+05  1.673333e+05   \n",
       "California           Fresno               1.857000e+05  1.874667e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals       1.216000e+05  1.280000e+05   \n",
       "Maryland             Piney Point          3.052333e+05  3.099667e+05   \n",
       "Wisconsin            Maribel              1.297333e+05  1.293000e+05   \n",
       "Idaho                Middleton            1.482000e+05  1.511333e+05   \n",
       "Colorado             Bennett              1.916667e+05  1.958000e+05   \n",
       "New Hampshire        East Hampstead       2.616000e+05  2.688000e+05   \n",
       "Missouri             Garden City          9.930000e+04  1.034333e+05   \n",
       "Arkansas             Mountainburg         8.370000e+04  9.043333e+04   \n",
       "Wisconsin            Oostburg             1.303333e+05  1.320333e+05   \n",
       "California           Twin Peaks           1.552667e+05  1.591667e+05   \n",
       "New York             Upper Brookville     1.777267e+06  1.834367e+06   \n",
       "Hawaii               Volcano              2.249667e+05  2.324333e+05   \n",
       "South Carolina       Wedgefield           7.033333e+04  6.903333e+04   \n",
       "Michigan             Williamston          1.794667e+05  1.823000e+05   \n",
       "Arkansas             Decatur              9.543333e+04  9.700000e+04   \n",
       "Tennessee            Briceville           4.793333e+04  4.360000e+04   \n",
       "Indiana              Edgewood             9.663333e+04  9.996667e+04   \n",
       "Tennessee            Palmyra              1.198000e+05  1.258000e+05   \n",
       "Maryland             Saint Inigoes        2.778333e+05  2.768333e+05   \n",
       "Indiana              Marysville           1.156667e+05  1.201667e+05   \n",
       "California           Forest Falls         1.911667e+05  1.987333e+05   \n",
       "Missouri             Bois D Arc           1.463000e+05  1.494333e+05   \n",
       "Virginia             Henrico              2.121000e+05  2.139667e+05   \n",
       "New Jersey           Diamond Beach        3.992333e+05  4.004333e+05   \n",
       "Tennessee            Gruetli Laager       6.950000e+04  7.170000e+04   \n",
       "Wisconsin            Town of Wrightstown  1.498667e+05  1.499333e+05   \n",
       "New York             Urbana               1.364667e+05  1.361667e+05   \n",
       "Wisconsin            New Denmark          1.884333e+05  1.889333e+05   \n",
       "California           Angels               2.635000e+05  2.795000e+05   \n",
       "Wisconsin            Holland              2.128667e+05  2.178333e+05   \n",
       "\n",
       "                                                2016Q1        2016Q2  \\\n",
       "State                RegionName                                        \n",
       "New York             New York             5.828667e+05  5.916333e+05   \n",
       "California           Los Angeles          5.660333e+05  5.774667e+05   \n",
       "Illinois             Chicago              2.060667e+05  2.082000e+05   \n",
       "Pennsylvania         Philadelphia         1.234333e+05  1.269333e+05   \n",
       "Arizona              Phoenix              1.879000e+05  1.914333e+05   \n",
       "Nevada               Las Vegas            1.946000e+05  1.972000e+05   \n",
       "California           San Diego            5.293333e+05  5.362333e+05   \n",
       "Texas                Dallas               1.405000e+05  1.446000e+05   \n",
       "California           San Jose             8.036000e+05  8.189333e+05   \n",
       "Florida              Jacksonville         1.339667e+05  1.372000e+05   \n",
       "California           San Francisco        1.121767e+06  1.119267e+06   \n",
       "Texas                Austin               2.935000e+05  3.014333e+05   \n",
       "Michigan             Detroit              3.796667e+04  3.746667e+04   \n",
       "Ohio                 Columbus             1.167000e+05  1.182000e+05   \n",
       "Tennessee            Memphis              7.090000e+04  7.416667e+04   \n",
       "North Carolina       Charlotte            1.664667e+05  1.694333e+05   \n",
       "Texas                El Paso              1.106667e+05  1.114667e+05   \n",
       "Massachusetts        Boston               4.826000e+05  4.903667e+05   \n",
       "Washington           Seattle              5.517333e+05  5.755333e+05   \n",
       "Maryland             Baltimore            1.146667e+05  1.147333e+05   \n",
       "Colorado             Denver               3.355667e+05  3.427667e+05   \n",
       "District of Columbia Washington           5.041000e+05  5.058000e+05   \n",
       "Tennessee            Nashville            1.950667e+05  2.003667e+05   \n",
       "Wisconsin            Milwaukee            9.466667e+04  9.636667e+04   \n",
       "Arizona              Tucson               1.495333e+05  1.511667e+05   \n",
       "Oregon               Portland             3.560000e+05  3.698000e+05   \n",
       "Oklahoma             Oklahoma City        1.279000e+05  1.293000e+05   \n",
       "Nebraska             Omaha                1.416333e+05  1.426667e+05   \n",
       "New Mexico           Albuquerque          1.691000e+05  1.706333e+05   \n",
       "California           Fresno               1.890333e+05  1.927333e+05   \n",
       "...                                                ...           ...   \n",
       "Texas                Granite Shoals       1.337667e+05  1.400667e+05   \n",
       "Maryland             Piney Point          3.195000e+05  3.241667e+05   \n",
       "Wisconsin            Maribel              1.278333e+05  1.292667e+05   \n",
       "Idaho                Middleton            1.539000e+05  1.571667e+05   \n",
       "Colorado             Bennett              1.997667e+05  2.074667e+05   \n",
       "New Hampshire        East Hampstead       2.725333e+05  2.778000e+05   \n",
       "Missouri             Garden City          1.062667e+05  1.116667e+05   \n",
       "Arkansas             Mountainburg         9.833333e+04  1.019000e+05   \n",
       "Wisconsin            Oostburg             1.327667e+05  1.341000e+05   \n",
       "California           Twin Peaks           1.641667e+05  1.679667e+05   \n",
       "New York             Upper Brookville     1.904500e+06  1.944067e+06   \n",
       "Hawaii               Volcano              2.420667e+05  2.489667e+05   \n",
       "South Carolina       Wedgefield           6.886667e+04  7.426667e+04   \n",
       "Michigan             Williamston          1.814667e+05  1.824000e+05   \n",
       "Arkansas             Decatur              9.650000e+04  9.663333e+04   \n",
       "Tennessee            Briceville           4.080000e+04  4.180000e+04   \n",
       "Indiana              Edgewood             9.943333e+04  9.996667e+04   \n",
       "Tennessee            Palmyra              1.276667e+05  1.328667e+05   \n",
       "Maryland             Saint Inigoes        2.793333e+05  2.826333e+05   \n",
       "Indiana              Marysville           1.282333e+05  1.232333e+05   \n",
       "California           Forest Falls         1.886333e+05  1.898667e+05   \n",
       "Missouri             Bois D Arc           1.468667e+05  1.437667e+05   \n",
       "Virginia             Henrico              2.160333e+05  2.162000e+05   \n",
       "New Jersey           Diamond Beach        4.045333e+05  4.039000e+05   \n",
       "Tennessee            Gruetli Laager       7.533333e+04  7.646667e+04   \n",
       "Wisconsin            Town of Wrightstown  1.498333e+05  1.512667e+05   \n",
       "New York             Urbana               1.389667e+05  1.442000e+05   \n",
       "Wisconsin            New Denmark          1.910667e+05  1.928333e+05   \n",
       "California           Angels               2.765333e+05  2.716000e+05   \n",
       "Wisconsin            Holland              2.219667e+05  2.280333e+05   \n",
       "\n",
       "                                             2016Q3  \n",
       "State                RegionName                      \n",
       "New York             New York              587200.0  \n",
       "California           Los Angeles           584050.0  \n",
       "Illinois             Chicago               212000.0  \n",
       "Pennsylvania         Philadelphia          128700.0  \n",
       "Arizona              Phoenix               195200.0  \n",
       "Nevada               Las Vegas             199950.0  \n",
       "California           San Diego             539750.0  \n",
       "Texas                Dallas                149300.0  \n",
       "California           San Jose              822200.0  \n",
       "Florida              Jacksonville          139900.0  \n",
       "California           San Francisco        1106400.0  \n",
       "Texas                Austin                304450.0  \n",
       "Michigan             Detroit                37900.0  \n",
       "Ohio                 Columbus              120100.0  \n",
       "Tennessee            Memphis                75900.0  \n",
       "North Carolina       Charlotte             172400.0  \n",
       "Texas                El Paso               112200.0  \n",
       "Massachusetts        Boston                501700.0  \n",
       "Washington           Seattle               589700.0  \n",
       "Maryland             Baltimore             115150.0  \n",
       "Colorado             Denver                351550.0  \n",
       "District of Columbia Washington            516250.0  \n",
       "Tennessee            Nashville             206100.0  \n",
       "Wisconsin            Milwaukee              98850.0  \n",
       "Arizona              Tucson                152700.0  \n",
       "Oregon               Portland              387050.0  \n",
       "Oklahoma             Oklahoma City         130300.0  \n",
       "Nebraska             Omaha                 143450.0  \n",
       "New Mexico           Albuquerque           171900.0  \n",
       "California           Fresno                196450.0  \n",
       "...                                             ...  \n",
       "Texas                Granite Shoals        146450.0  \n",
       "Maryland             Piney Point           324600.0  \n",
       "Wisconsin            Maribel               134200.0  \n",
       "Idaho                Middleton             160750.0  \n",
       "Colorado             Bennett               212600.0  \n",
       "New Hampshire        East Hampstead        282450.0  \n",
       "Missouri             Garden City           113600.0  \n",
       "Arkansas             Mountainburg          103400.0  \n",
       "Wisconsin            Oostburg              136350.0  \n",
       "California           Twin Peaks            173500.0  \n",
       "New York             Upper Brookville     1968800.0  \n",
       "Hawaii               Volcano               247850.0  \n",
       "South Carolina       Wedgefield             80700.0  \n",
       "Michigan             Williamston           183000.0  \n",
       "Arkansas             Decatur                96850.0  \n",
       "Tennessee            Briceville             40850.0  \n",
       "Indiana              Edgewood              100950.0  \n",
       "Tennessee            Palmyra               137750.0  \n",
       "Maryland             Saint Inigoes         281400.0  \n",
       "Indiana              Marysville            124200.0  \n",
       "California           Forest Falls          186650.0  \n",
       "Missouri             Bois D Arc            144000.0  \n",
       "Virginia             Henrico               220150.0  \n",
       "New Jersey           Diamond Beach         399000.0  \n",
       "Tennessee            Gruetli Laager         77500.0  \n",
       "Wisconsin            Town of Wrightstown   155000.0  \n",
       "New York             Urbana                143000.0  \n",
       "Wisconsin            New Denmark           197600.0  \n",
       "California           Angels                269950.0  \n",
       "Wisconsin            Holland               234950.0  \n",
       "\n",
       "[10730 rows x 67 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def convert_housing_data_to_quarters():\n",
    "    '''Converts the housing data to quarters and returns it as mean \n",
    "    values in a dataframe. This dataframe should be a dataframe with\n",
    "    columns for 2000q1 through 2016q3, and should have a multi-index\n",
    "    in the shape of [\"State\",\"RegionName\"].\n",
    "    \n",
    "    Note: Quarters are defined in the assignment description, they are\n",
    "    not arbitrary three month periods.\n",
    "    \n",
    "    The resulting dataframe should have 67 columns, and 10,730 rows.\n",
    "    '''\n",
    "    \n",
    "    df = pd.read_csv('City_Zhvi_AllHomes.csv')\n",
    "    states = {'OH': 'Ohio', 'KY': 'Kentucky', 'AS': 'American Samoa', 'NV': 'Nevada', 'WY': 'Wyoming', 'NA': 'National', 'AL': 'Alabama', 'MD': 'Maryland', 'AK': 'Alaska', 'UT': 'Utah', 'OR': 'Oregon', 'MT': 'Montana', 'IL': 'Illinois', 'TN': 'Tennessee', 'DC': 'District of Columbia', 'VT': 'Vermont', 'ID': 'Idaho', 'AR': 'Arkansas', 'ME': 'Maine', 'WA': 'Washington', 'HI': 'Hawaii', 'WI': 'Wisconsin', 'MI': 'Michigan', 'IN': 'Indiana', 'NJ': 'New Jersey', 'AZ': 'Arizona', 'GU': 'Guam', 'MS': 'Mississippi', 'PR': 'Puerto Rico', 'NC': 'North Carolina', 'TX': 'Texas', 'SD': 'South Dakota', 'MP': 'Northern Mariana Islands', 'IA': 'Iowa', 'MO': 'Missouri', 'CT': 'Connecticut', 'WV': 'West Virginia', 'SC': 'South Carolina', 'LA': 'Louisiana', 'KS': 'Kansas', 'NY': 'New York', 'NE': 'Nebraska', 'OK': 'Oklahoma', 'FL': 'Florida', 'CA': 'California', 'CO': 'Colorado', 'PA': 'Pennsylvania', 'DE': 'Delaware', 'NM': 'New Mexico', 'RI': 'Rhode Island', 'MN': 'Minnesota', 'VI': 'Virgin Islands', 'NH': 'New Hampshire', 'MA': 'Massachusetts', 'GA': 'Georgia', 'ND': 'North Dakota', 'VA': 'Virginia'}\n",
    "    \n",
    "    #Drop columns which are irrelevant\n",
    "    df = df.drop(['RegionID', 'Metro', 'CountyName', 'SizeRank'], axis = 1)\n",
    "    \n",
    "    #Replace the state name using full state name, then set index\n",
    "    df['State'] = df['State'].replace(states)\n",
    "    df = df.set_index(['State', 'RegionName'])\n",
    "    \n",
    "    #Drop years from 1996 to 1999\n",
    "    drop_list = list(range(0, 45))\n",
    "    df = df.drop(df.columns[drop_list], axis = 1)\n",
    "    \n",
    "    #Group time period using Quarter as period and calculate its mean\n",
    "    df = df.groupby(pd.PeriodIndex(df, freq = 'Q'), axis = 1).mean()\n",
    "    \n",
    "    \n",
    "    return df\n",
    "\n",
    "convert_housing_data_to_quarters()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "umich_part_id": "026",
    "umich_partlist_id": "004"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(True, 0.0043252148535112009, 'university town')"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def run_ttest():\n",
    "    '''First creates new data showing the decline or growth of housing prices\n",
    "    between the recession start and the recession bottom. Then runs a ttest\n",
    "    comparing the university town values to the non-university towns values, \n",
    "    return whether the alternative hypothesis (that the two groups are the same)\n",
    "    is true or not as well as the p-value of the confidence. \n",
    "    \n",
    "    Return the tuple (different, p, better) where different=True if the t-test is\n",
    "    True at a p<0.01 (we reject the null hypothesis), or different=False if \n",
    "    otherwise (we cannot reject the null hypothesis). The variable p should\n",
    "    be equal to the exact p value returned from scipy.stats.ttest_ind(). The\n",
    "    value for better should be either \"university town\" or \"non-university town\"\n",
    "    depending on which has a lower mean price ratio (which is equivilent to a\n",
    "    reduced market loss).'''\n",
    "    \n",
    "    recession_start = get_recession_start()\n",
    "    recession_bottom = get_recession_bottom()\n",
    "    df = convert_housing_data_to_quarters()\n",
    "    university_towns = get_list_of_university_towns()\n",
    "\n",
    "    #Calculate the difference between receisson start and recession bottom\n",
    "    diff = df[recession_start] - df[recession_bottom]\n",
    "    \n",
    "    #Get non-university towns by using all states & regionName minus university towns\n",
    "    university_towns = university_towns.set_index(['State', 'RegionName'])\n",
    "    non_university_towns = set(df.index) - set(university_towns.index)\n",
    "    \n",
    "    #University towns dataframe with its housing price\n",
    "    university_towns_df = diff.loc[list(set(university_towns.index))].dropna()\n",
    "    \n",
    "    #Dataframe of non-university towns with its housing price\n",
    "    non_university_towns_df = diff.loc[list(non_university_towns)].dropna()\n",
    "    \n",
    "    #Ttest using the housing price of university towns and non-university towns\n",
    "    statistic, p_value = ttest_ind(university_towns_df, non_university_towns_df)\n",
    "    if p_value < 0.01:\n",
    "        different = True\n",
    "    else:\n",
    "        different = False\n",
    "    if non_university_towns_df.mean() < university_towns_df.mean():\n",
    "        better = 'non-university town'\n",
    "    else:\n",
    "        better = 'university town'\n",
    "\n",
    "\n",
    "    #Alternatives:\n",
    "    \n",
    "#     #Create a dataframe of the difference between receisson start and recession bottom\n",
    "#     price_diff = pd.DataFrame((df[get_recession_start()] - df[get_recession_bottom()]), columns = ['Price'])\n",
    "#     price_diff = price_diff.reset_index()\n",
    "    \n",
    "#     #Add State and RegionName together in order to do the comparison\n",
    "#     university_towns['State & RegionName'] = university_towns['State'] + university_towns['RegionName']\n",
    "    \n",
    "#     #Compare using all states & regionName with university towns\n",
    "#     price_diff['uni_towns'] = price_diff.apply(lambda x : x['State'] + x['RegionName'] in list(university_towns['State & RegionName']), axis=1)\n",
    "    \n",
    "#     #True if university towns are in all states & RegionName list\n",
    "#     uni_towns = price_diff[price_diff['uni_towns'] == True].dropna()\n",
    "    \n",
    "#     #False if university towns are in all states & RegionName list\n",
    "#     non_uni_towns = price_diff[price_diff['uni_towns'] == False].dropna()\n",
    "    \n",
    "#     #Ttest using the housing price\n",
    "#     statistic, p_value = ttest_ind(uni_towns['Price'], non_uni_towns['Price'])\n",
    "    \n",
    "#     if p_value < 0.01:\n",
    "#         different = True\n",
    "#     else:\n",
    "#         different = False\n",
    "#     if non_uni_towns['Price'].mean() < uni_towns['Price'].mean():\n",
    "#         better = 'non-university town'\n",
    "#     else:\n",
    "#         better = 'university town'\n",
    "\n",
    "    return (different, p_value, better)\n",
    "\n",
    "\n",
    "run_ttest()"
   ]
  }
 ],
 "metadata": {
  "coursera": {
   "course_slug": "python-data-analysis",
   "graded_item_id": "Il9Fx",
   "launcher_item_id": "TeDW0",
   "part_id": "WGlun"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  },
  "umich": {
   "id": "Assignment 4",
   "version": "1.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
